i'am just getting started with Dymola and Modelica in general. I've made a small model from parts of the Modelica library. The model consists of the "DynamicPipe", the "MassFlowSource_T", the "FixedBoundary" and a Step to increase the mass flow at a given time. My goal is to vary the diameter and the length of the pipe and see how long it takes for the mass flow to stabilize.
I've written a small script to vary the diameter and the length of the pipe an write the mass flow to a .csv file.
openModel("C:\Dymola\Modelica_Rohrmodel.mo")
translateModel("Modelica_Rohrmodel");
for j in 0.0 : 0.1 : 1 loop
pipe.diameter = j;
for i in 0 : 5 : 100 loop
pipe.length = i;
simulate();
fileName="Modelica_Rohrmodel.mat";
n=readTrajectorySize(fileName);
names={"boundary.ports[1].m_flow"};
traj=readTrajectory(fileName,names,n);
traj_transposed=transpose(traj);
CSVfile="Massflow"+String(j)+"_"+String(i)+".csv";
DataFiles.writeCSVmatrix(CSVfile, names, traj_transposed);
end for;
end for;
The script moslty works, but i get: Warning: setting pipe.lenght has no effect in model. After translation you can only set literal start-values and non-evaluated parameters.
I've already tried to change the annotation to Evaluate=false, but failed.
https://www.claytex.com/blog/methods/modifying-evaluated-parameters-in-multiple-simulations/ I found this solution, but I don't know how to apply it to my problem.
