// Script to generate plot for documentation of
// function PressureLoss.General.dp_nominalDensityViscosity_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_nominalDensityViscosity_DPMFLOW");

Advanced.StoreProtectedVariables:=true;

simulateModel("ModelicaTest.Fluid.Dissipation.Verifications.PressureLoss.General.dp_nominalDensityViscosity_DPMFLOW",startTime=0, stopTime=1, numberOfIntervals=5000, method="dassl", tolerance=1e-005, resultFile="dp_nominalDensityViscosity_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): Density and viscosity dependence (Water, exp == 2, exp_eta = 1.5, dp_nom = 50 Pa, m_flow_nom = 1 kg/s)",
 range = {0, 100.0, 800000.0, (-100000.0)},
 autoscale = true,
 autoerase = true,
 autoreplot = true,
 description = false,
 grid = true,
 color = true,
 online = false,
 filename = "dp_nominalDensityViscosity_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_nominalDensityViscosity_DPMFLOW.mat",
 leftTitle = "(Output) Mass flow rate [kg/s]",
 bottomTitle ="(Input) Mass flow rate [kg/s]");

Modelica.Utilities.System.setWorkDirectory(currentDirectory);
