// Script to generate plot for documentation of
// function HeatTransfer.StraightPipe.kc_turbulent_KC
// of FluidDissipation Library
//
// Generated by Thorben Vahlenkamp
// 20-02-2009
// last change: 25-03-2009
// XRG Simulation GmbH

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

translateModel("ModelicaTest.Fluid.Dissipation.Verifications.HeatTransfer.StraightPipe.kc_turbulent_KC");

Advanced.StoreProtectedVariables:=true;

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

switchToSimulationMode();

removePlots();
//neglecting pressure loss influence
createPlot(id = 1,
 position = {(-2), (-21), 708, 403},
 x = "Nu[1]",
 y = {
	"Re_1[1]",
	"Re_1[2]",
	"Re_1[3]"},
 heading = "Straight pipe (inverted): Heat transfer for turbulent flow regime neglecting pressure loss dependence (d_hyd / L = 0.1)",
 range = {1e1, 1e4, 1e6, 1e4},
 autoscale = false,
 autoerase = true,
 autoreplot = true,
 description = false,
 grid = true,
 color = true,
 online = false,
 logX = true,
 logY = true,
 filename = "kc_turbulent_KC.mat",
 legends = {
	"Pr= 0.72 (Air)",
	"Pr= 7 (Water)",
	"Pr= 1000 (Antifreeze)"
},
 leftTitle = "Reynolds number [-]",
 bottomTitle = "Nusselt number [-]");

//considering pressure loss influence
createPlot(id = 2,
position = {711, (-21), 708, 403},
 x = "Nu[1]",
 y = {
	"Re_2[1]",
	"Re_2[2]",
	"Re_2[3]"},
 heading = "Straight pipe (inverted): Heat transfer for turbulent flow regime considering pressure loss dependence (d_hyd / L = 0.1)",
 range = {1e1, 1e4, 1e6, 1e4},
 autoscale = false,
 autoerase = true,
 autoreplot = true,
 description = false,
 grid = true,
 color = true,
 online = false,
 logX = true,
 logY = true,
 filename = "kc_turbulent_KC.mat",
 legends = {
	"Pr= 0.72 (Air)",
	"Pr= 7 (Water)",
	"Pr= 1000 (Antifreeze)"
},
  leftTitle = "Reynolds number [-]",
 bottomTitle = "Nusselt number [-]");

Modelica.Utilities.System.setWorkDirectory(currentDirectory);
