Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » satart
  • » Profile

Posts

Posts

Hi,

i'm a new modelica user and need to work with dinamic pipes of standard fluid library.
With the dynamic pipe it is possible to assign heat transfer coefficient k as a parameter.

But i would like to change this value by a calculation.

Here is  minimal example:

Code:


model Test
  replaceable package Medium =
      Modelica.Media.Water.ConstantPropertyLiquidWater;
  Modelica.Fluid.Pipes.DynamicPipe pipe(
    redeclare package Medium = Medium,
    length=100,
    diameter=0.1,
    use_HeatTransfer=true,
    redeclare model HeatTransfer =
        Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.IdealFlowHeatTransfer (
          k=10)) ;
 
  Modelica.Fluid.Sources.MassFlowSource_T boundary(nPorts=1, redeclare package
      Medium = Medium) ;
  Modelica.Fluid.Sources.Boundary_pT boundary1(nPorts=1, redeclare package
      Medium = Medium) ;
  inner Modelica.Fluid.System system ;
equation

pipe.heatTransfer.k = 300; 

  connect(pipe.port_b, boundary1.ports[1]);
  connect(boundary.ports[1], pipe.port_a);
end Test;

The line with "pipe.heatTransfer.k = 300;  " do not work.
So is it possible to caculate a value and assign it during a simulation?

Thank you

  • Index
  • » Users
  • » satart
  • » Profile
You are here: