// Script to generate plot for documentation of
// function PressureLoss.General.dp_pressureLossCoefficient_DP and dp_pressureLossCoefficient_MFLOw
// of FluidDissipation Library
//
// Generated by Thorben Vahlenkamp
// 15-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_pressureLossCoefficient_DPMFLOW");

Advanced.StoreProtectedVariables:=true;

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

switchToSimulationMode();

removePlots();
createPlot(id = 1,
 position = {(-2), (-21), 708, 403},
 x = "input_dp[1]",
 y = {
	"input_mdot[1]",
	"input_mdot[2]",
	"input_mdot[3]"
},
 heading = "General (inverse): Generic pressure loss with pressure loss coefficient dependence (Air, d_hyd = 0.1 m)",
 range = {0, 100, 5000,0},
 autoscale = true,
 autoerase = true,
 autoreplot = true,
 description = false,
 grid = true,
 color = true,
 online = false,
 filename = "dp_pressureLossCoefficient_DPMFLOW.mat",
 legends = {
	"pressure loss coefficient zeta_TOT=0.01",
	"zeta_TOT=0.1",
	"zeta_TOT=1"},
 leftTitle = "Mass flow rate [kg/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_idealGas_DPMFLOW.mat",
 leftTitle = "(Output) Mass flow rate [kg/s]",
 bottomTitle = "(Input) Mass flow rate [kg/s]");

Modelica.Utilities.System.setWorkDirectory(currentDirectory);
