// Script to generate plot for documentation of
// function PressureLoss.General.dp_volumeFlowRate_DPMFLOW
// of FluidDissipation Library
//
// Generated by Thorben Vahlenkamp
// 16-04-2008
// last change: 25-05-2009
// XRG Simulation GmbH

currentDirectory = Modelica.Utilities.System.getWorkDirectory();
cd(Modelica.Utilities.System.getEnvironmentVariable("temp"));

translateModel("ModelicaTest.Fluid.Dissipation.Verifications.PressureLoss.General.dp_volumeFlowRate_DPMFLOW");

Advanced.StoreProtectedVariables:=true;

simulateModel("ModelicaTest.Fluid.Dissipation.Verifications.PressureLoss.General.dp_volumeFlowRate_DPMFLOW",startTime=0, stopTime=1, numberOfIntervals=5000, method="dassl", tolerance=1e-005, resultFile="dp_volumeFlowRate_DPMFLOW");

switchToSimulationMode();

removePlots();
createPlot(id = 1,
 position = {(-2), (-21), 708, 403},
 x="input_dp[1]",
 y = {
	"V_flow[1]",
	"V_flow[2]",
	"V_flow[3]"},
  heading = "General (inverse): Quadratic volume flow rate dependence [dp=a*V_flow^2 + b*V_flow, b == 0, Air)",
 range = {0, 5e5, 0.1,0},
 autoscale = true,
 autoerase = true,
 autoreplot = true,
 description = false,
 grid = true,
 color = true,
 online = false,
 filename = "dp_volumeFlowRate_DPMFLOW.mat",
 legends = {
	"a = 15",
	"30",
	"45"},
 leftTitle = "Volume flow rate [m3/s]",
 bottomTitle = "Pressure loss [Pa]");


createPlot(id = 5,
   position = {375, 177, 708, 412},
  x="input_mdot[1]",
 y = {
	"input_mdot[1]",
	"input_mdot[2]",
	"input_mdot[3]",
	"M_FLOW[1]",
	"M_FLOW[2]",
	"M_FLOW[3]"},
 heading = "check",
 range = {0, 0.1, 5e5, 0},
 autoscale = true,
 autoerase = true,
 autoreplot = true,
 description = false,
 grid = true,
 color = true,
 online = false,
  filename = "dp_volumeFlowRate_DPMFLOW.mat",
 leftTitle = "(Output) Mass flow rate [kg/s]",
 bottomTitle = "(Input) Mass flow rate [kg/s]");

Modelica.Utilities.System.setWorkDirectory(currentDirectory);
