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

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

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

Advanced.StoreProtectedVariables:=true;

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

switchToSimulationMode();

removePlots();
createPlot(id = 1,
  position = {(-2), (-21), 708, 403},
 x = "Nu[1]",
 y = {
	"Re_1[1]",
	"Re_1[2]",
	"Re_1[3]"},
 heading = "Helical pipe (inverted): Heat transfer for turbulent regime (n_nt= 1, d_hyd= 0.01m, L= 10m, h= 0.015m)",
 range = {1e2, 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 [-]");

createPlot(id = 2,
  position = {711, (-21), 708, 403},
 x = "Nu[1]",
 y = {
	"Re_2[1]",
	"Re_2[2]",
	"Re_2[3]"},
 heading = "Helical pipe (inverted): Heat transfer for turbulent regime (n_nt= 5, d_hyd= 0.01m, L= 10m, h= 0.015m)",
 range = {1e2, 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 [-]");

createPlot(id = 3,
  position = {(-4), 400, 708, 406},
 x = "Nu[1]",
 y = {
	"Re_3[1]",
	"Re_3[2]",
	"Re_3[3]"},
 heading = "Helical pipe (inverted): Heat transfer for turbulent regime (n_nt= 10, d_hyd= 0.01m, L= 10m, h= 0.015m)",
range = {1e2, 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 [-]");

createPlot(id = 4,
  position = {708, 400, 708, 403},
 x = "Nu[1]",
 y = {
	"Re_1[2]",
	"Re_2[2]",
	"Re_3[2]"},
 heading = "Helical pipe (inverted): Heat transfer for turbulent regime (Water, d_hyd= 0.01m, L= 10m, h= 0.015m)",
range = {1e2, 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 = {
	"number of turns n_nt = 1",
	"n_nt = 5",
	"n_nt = 10"
},
 leftTitle = "Reynolds number [-]",
 bottomTitle = "Nusselt number [-]");

Modelica.Utilities.System.setWorkDirectory(currentDirectory);
