// Script to generate plot for documentation of
// function PressureLoss.Orifice.dp_thickEdgedOverall_DPMFLOW_DP AND dp_thickEdgedOverall_MFLOW
// of FluidDissipation Library
//
// Generated by Thorben Vahlenkamp
// 01-10-2008
// last change: 27-05-2008
// XRG Simulation GmbH
currentDirectory = Modelica.Utilities.System.getWorkDirectory();
cd(Modelica.Utilities.System.getEnvironmentVariable("temp"));

Evaluate = false;
Advanced.StoreProtectedVariables:=true;

translateModel("ModelicaTest.Fluid.Dissipation.Verifications.PressureLoss.Orifice.dp_thickEdgedOverall_DPMFLOW");

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

switchToSimulationMode();


removePlots();
createPlot(id = 1,
 position = {40, 22, 543, 515},
 x = "l_bar",
 y = {
	"zeta_TOT[1]",
	"zeta_TOT[2]",
	"zeta_TOT[3]",
	"zeta_TOT[4]",
	"zeta_TOT[5]",
	"zeta_TOT[6]"
},
heading = "Orifice (inverse): Thick edged (A_0= 0.001m2)",
 range = {0, 11.0, 10000.0, 0.1},
 autoscale = false,
 autoerase = false,
 autoreplot = false,
 description = false,
 grid = true,
 color = true,
 online = false,
 legendLocation = 2,
 legends = {
	"A_0/A_1 = 0.02",
	"A_0/A_1 = 0.08",
	"A_0/A_1 = 0.20",
	"A_0/A_1 = 0.40",
	"A_0/A_1 = 0.70",
	"A_0/A_1 = 0.90"
},
 filename = "dp_thickEdgedOverall_DPMFLOW.mat",
 logY = true,
 leftTitle = "Pressure loss coefficient (zeta_TOT [-])",
 bottomTitle = "Relative length of orifice (L/d_hyd_0 [-])");


createPlot(id = 2,
 position = {594, 22, 544, 518},
 x= "input_dp[1]",
 y = {
	"input_mdot[1]",
	"input_mdot[2]",
	"input_mdot[3]",
	"input_mdot[4]",
	"input_mdot[5]",
	"input_mdot[5]"
},
 heading = "Orifice (inverse): Thick edged (Water,A_0= 0.001m2)",
 range = {0, 1e0, 9e2, 0},
 autoscale = true,
 autoerase = false,
 autoreplot = false,
 description = false,
 grid = true,
 color = true,
 online = false,
legendLocation = 2,
legends = {
	"A_0/A_1 = 0.02",
	"A_0/A_1 = 0.08",
	"A_0/A_1 = 0.20",
	"A_0/A_1 = 0.40",
	"A_0/A_1 = 0.70",
	"A_0/A_1 = 0.90"
},
 filename = "dp_thickEdgedOverall_DPMFLOW.mat",
 leftTitle = "Mass flow rate [kg/s]",
 bottomTitle = "Pressure loss [Pa]");


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

Modelica.Utilities.System.setWorkDirectory(currentDirectory);
