// Script to generate plot for documentation of
// function PressureLoss.Channel.dp_internalFlowOverall_DP AND dp_internalFlowOverall_MFLOW
// of FluidDissipation Library
//
// Generated by Thorben Vahlenkamp
// 03-09-2009
// last change: 04-09-2009
// XRG Simulation GmbH

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

translateModel("ModelicaTest.Fluid.Dissipation.Verifications.PressureLoss.Channel.dp_internalFlowOverall_DPMFLOW");

Advanced.StoreProtectedVariables:=true;

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

switchToSimulationMode();

removePlots();
createPlot(id = 1,
 position = {(-2), (-21), 708, 403},
  x="DP_plot_1[1]",
 y = {
	"M_FLOW_1[1]",
	"M_FLOW_1[2]",
	"M_FLOW_1[3]",
	"M_FLOW_1[4]",
	"M_FLOW_1[5]"
},
   heading = "(Smooth) Channel: Geometry dependence (identic hydraulic diameter)",
 range = {0, 1e3, 1e2, 0},
 autoscale = false,
 autoerase = false,
 autoreplot = true,
 description = false,
 grid = true,
 color = true,
 online = false,
 filename = "dp_internalFlowOverall_DPMFLOW.mat",
 logX = false,
 logY = false,
 legends = {
	"Annular",
	"Circular",
	"Elliptical",
	"Rectangular",
	"Triangular"
},
 leftTitle = "Mass flow rate ([kg/s])",
 bottomTitle = "Pressure loss [Pa]");


createPlot(id = 2,
 position = {(-2), 400, 708, 403},
  x="DP_plot_1[1]",
 y = {
	"velocity_1[1]",
	"velocity_1[2]",
	"velocity_1[3]",
	"velocity_1[4]",
	"velocity_1[5]"
},
   heading = "(Smooth) Channel: Geometry dependence (identic hydraulic diameter)",
 range = {0, 1e3, 1e2, 0},
 autoscale = true,
 autoerase = false,
 autoreplot = true,
 description = false,
 grid = true,
 color = true,
 online = false,
 filename = "dp_internalFlowOverall_DPMFLOW.mat",
 logX = false,
 logY = false,
 legends = {
	"Annular",
	"Circular",
	"Elliptical",
	"Rectangular",
	"Triangular"
},
 leftTitle = "Mass flow rate ([kg/s])",
 bottomTitle = "Pressure loss [Pa]");


createPlot(id = 4,
   position = {375, 177, 708, 412},
  x = "input_mdot_1[1]",
 y = {
	"input_mdot_1[1]",
	"input_mdot_1[2]",
	"input_mdot_1[3]",
	"input_mdot_1[4]",
	"input_mdot_1[5]",
	"M_FLOW_1[1]",
	"M_FLOW_1[2]",
	"M_FLOW_1[3]",
	"M_FLOW_1[4]",
	"M_FLOW_1[5]"

},
 heading = "Check",
 range = {0, 0.1, 5e5, 0},
 autoscale = true,
 autoerase = true,
 autoreplot = true,
 description = false,
 grid = true,
 color = true,
 online = false,
 filename = "dp_internalFlowOverall_DPMFLOW.mat",
 leftTitle = "(Output) Mass flow rate [kg/s]",
 bottomTitle = "(Input) Mass flow rate [kg/s]");


Modelica.Utilities.System.setWorkDirectory(currentDirectory);
