Hi,
I have tried to compile in JModelica a dummy model of the pipe. The model is composed by a flow source, a pressure sink, and a very simplified model of pipe.
The problem is that I impose the pressure in the sink but JModelica doesn't consider it, because in the pipe model I have the derivate of the pressure, and practically it considers the der(p) like a variable.
In Dymola I compiled and simulated the model without any problem.
Error: in file 'test.plant.mof':
Semantic error at line 0, column 0:
The DAE system has 5 equations and 6 free variables.
This is the pipe model:
package test
connector FlangeB "B-type flange connector for water/steam flows"
AbsolutePressure p "Pressure";
flow MassFlowRate w "Mass flowrate";
input SpecificEnthalpy hAB "Specific enthalpy of entering fluid";
output SpecificEnthalpy hBA "Specific enthalpy of fluid going out";
end FlangeB;
connector FlangeA "A-type flange connector for water/steam flows"
AbsolutePressure p "Pressure";
flow MassFlowRate w "Mass flowrate";
output SpecificEnthalpy hAB "Specific enthalpy of fluid going out";
input SpecificEnthalpy hBA "Specific enthalpy of entering fluid";
end FlangeA;
model example
constant Real drhodp=1;
SpecificEnthalpy h;
AbsolutePressure p "Fluid pressure for property calculations";
Real dM;
MassFlowRate w "Mass flowrate (single tube)";
FlangeB outfl ;
FlangeA infl ;
equation
outfl.p - infl.p = 0 "Momentum balance";
infl.w + outfl.w = dM "Mass balance";
dM=drhodp*der(p);
w = infl.w;
p = outfl.p;
infl.hAB = h;
h=infl.hBA;
outfl.hBA = h;
end example;
end test;
Here the complete model (plant).
http://jmodelica.org/sites/default/files/testJM.mo__0.txt
What do you think, is it a problem at compilation with JModelica or I'm wrong?
Best regards
/Adrian