// Script to generate plot for documentation of
// function PressureLoss.StraightPipe.dp_twoPhaseOverall_DP
// of FluidDissipation Library
//
// Generated by Nina Peci
// 02-09-2009
// last change: 24-02-2010
// XRG Simulation GmbH

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

translateModel("ModelicaTest.Fluid.Dissipation.Verifications.PressureLoss.StraightPipe.dp_twoPhaseOverall_DP");

Advanced.StoreProtectedVariables:=true;

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

switchToSimulationMode();

removePlots();


createPlot(id = 1,
   position = {(0), (-20), 550, 320},
 x = "x_flow",
y = {"DP_1[1]",
	  "DP_1[2]",
	  "DP_1[3]"},
 heading = "Straight pipe: Pressure loss (Friedel) for two phase flow (CO2, m_A=300 kg/m2s)",
 range = {0, 1, 0, 0.2},
 autoscale = true,
 autoerase = false,
 autoreplot = true,
 description = false,
 grid = true,
 color = true,
 online = false,
 filename = "dp_twoPhaseOverall_DP.mat",
 legends = {
	"t=0 degC",
	"t=10 degC",
	"t=20 degC"
	},
 leftTitle = "Pressure loss [bar]",
 bottomTitle ="Mass flow rate quality [-]");

createPlot(id = 2,
 position = {(0), 330, 550, 320},
 x="x_flow",
 y = {"DP_1[4]",
	  "DP_1[2]",
	  "DP_1[5]"},
 heading = "Straight pipe: Pressure loss (Friedel) for two phase flow (CO2, t=10degC)",
range = {0, 1, 0, 0.2},
 autoscale = true,
 autoerase = true,
 autoreplot = true,
 description = false,
 grid = true,
 color = true,
 online = false,
 filename = "dp_twoPhaseOverall_DP.mat",
 logX = false,
 logY = false,
legends = {
	"m_A=200 kg/m2s",
	"m_A=200 kg/m2s",
	"m_A=200 kg/m2s"
	},
 leftTitle = "Pressure loss [bar]",
bottomTitle = "Mass flow rate quality [-]");

createPlot(id = 3,
   position = {560, (-20), 550, 320},
 x = "x_flow",
y = {"DP_2[1]",
	  "DP_2[2]",
	  "DP_2[3]"},
 heading = "Straight pipe: Pressure loss (Chisholm) for two phase flow (CO2, m_A=300 kg/m2s)",
 range = {0, 1, 0, 0.2},
 autoscale = true,
 autoerase = false,
 autoreplot = true,
 description = false,
 grid = true,
 color = true,
 online = false,
filename = "dp_twoPhaseOverall_DP.mat",
 legends = {
	"t=0 degC",
	"t=10 degC",
	"t=20 degC"
	},
 leftTitle = "Pressure loss [bar]",
 bottomTitle ="Mass flow rate quality [-]");

createPlot(id = 4,
 position = {560, 330, 550, 320},
 x="x_flow",
 y = {"DP_2[4]",
	  "DP_2[2]",
	  "DP_2[5]"},
 heading = "Straight pipe: Pressure loss (Chisholm) for two phase flow (CO2, t=10degC)",
range = {0, 1, 0, 0.2},
 autoscale = true,
 autoerase = true,
 autoreplot = true,
 description = false,
 grid = true,
 color = true,
 online = false,
 filename = "dp_twoPhaseOverall_DP.mat",
 logX = false,
 logY = false,
legends = {
	"m_A=200 kg/m2s",
	"m_A=300 kg/m2s",
	"m_A=400 kg/m2s"
	},
 leftTitle = "Pressure loss [bar]",
bottomTitle = "Mass flow rate quality [-]");

Modelica.Utilities.System.setWorkDirectory(currentDirectory);
