// Script to generate plot for documentation of
// function PressureLoss.General.dp_nominalPressureLossLawDensity_DP and dp_nominalPressureLossLawDensity_MFLOW
// of FluidDissipation Library
//
// Generated by Thorben Vahlenkamp
// 03-12-2008
// last change: 25-05-2008
// XRG Simulation GmbH

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

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

Advanced.StoreProtectedVariables:=true;

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

switchToSimulationMode();

removePlots();
createPlot(id = 1,
 position = {(-2), (-21), 708, 406},
 x="input_dp[1]",
 y = {
	"input_mdot[1]",
	"input_mdot[2]",
	"input_mdot[3]"
},
heading = "General (inverse): Pressure loss law dependence (zeta_TOT/zeta_TOT_nom=0.5, exp=2, dp_nom=50Pa, m_flow_nom=1kg/s)",
 range = {0, 100.0, 550000.0, (-50000.0)},
 autoscale = true,
 autoerase = true,
 autoreplot = true,
 description = false,
 grid = true,
 color = true,
 online = false,
 filename = "dp_nominalPressureLossLawDensity_DPMFLOW.mat",
 legends = {
	"rho / rho_nom = 1",
	"1.5",
	"2"},
 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_nominalPressureLossLawDensity_DPMFLOW.mat",
 legends = {
	"K = Km / R_s = 5.95",
	"23.78",
	"35.68",
	"K = Km / R_s = 5.95",
	"23.78",
	"35.68"},
 leftTitle = "(Output) Mass flow rate [kg/s]",
 bottomTitle = "(Input) Mass flow rate [kg/s]");

Modelica.Utilities.System.setWorkDirectory(currentDirectory);
