// Script to generate plot for documentation of
// function PressureLoss.Bend.dp_edgedOverall_MFLOW AND dp_edgedOverall_DP
// of FluidDissipation Library
//
// Generated by Thorben Vahlenkamp
// 13-08-2008
// last change: 27-05-2008
// XRG Simulation GmbH

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

translateModel("ModelicaTest.Fluid.Dissipation.Verifications.PressureLoss.Bend.dp_edgedOverall_DPMFLOW");

Advanced.StoreProtectedVariables:=true;

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

switchToSimulationMode();

removePlots();
createPlot(id = 1,
 position = {(-2), (-21), 708, 406},
 x = "Re[1]",
 y = {	"zeta_TOT[1]",
	"zeta_TOT[2]",
	"zeta_TOT[3]",
	"zeta_TOT[4]"
},
  heading = "Edged bend at different angles of turning (L/d_hyd= 10,K= 2.5e-5m)",
 range = {2e1, 1e6, 1e1, 1e-2},
 autoscale = false,
 autoerase = false,
 autoreplot = true,
 description = false,
 grid = true,
 color = true,
 online = false,
 filename = "dp_edgedOverall_DPMFLOW.mat",
 logX = true,
 logY = true,
 legends = {
	"angle of turning delta = 30deg",
	"delta = 45deg",
	"delta = 90deg",
	"delta = 180deg"},
 leftTitle = "Pressure loss coefficient (zeta_TOT [-])",
 bottomTitle = "Reynolds number[-]");

createPlot(id = 2,
 position = {(-2), 400, 708, 403},
 x = "input_dp[1]",
 y = {
	"input_mdot[1]",
	"input_mdot[2]",
	"input_mdot[3]",
	"input_mdot[4]"
},
  heading = "Edged bend at different angles of turning (Water, L/d_hyd= 10,K= 2.5e-5m)",
 range = {0, 1e2, 3.5e5, 0},
 autoscale = true,
 autoerase = false,
 autoreplot = true,
 description = false,
 grid = true,
 color = true,
 online = false,
 legends = {
	"angle of turning delta = 30deg",
	"delta = 45deg",
	"delta = 90deg",
	"delta = 180deg"},
 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_edgedOverall_DPMFLOW.mat",
 leftTitle = "(Output) Mass flow rate [kg/s]",
 bottomTitle ="(Input) Mass flow rate [kg/s]");

Modelica.Utilities.System.setWorkDirectory(currentDirectory);
