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

Optional / Conditional Heat Flow

Optional / Conditional Heat Flow

Hello,

I'm quite new to Modelica and I don't know what's the best way to approach my problem.
I have two "rooms" (basically two Fluid.ClosedVolume components) which are separated by a wall, which is nothing more than a combination of a heat conductor and a heat capacitor.
What I want to do now, is to make this wall removable.
That means that during the runtime, the two rooms can be joined or separated.

My plan was/is to adapt the heat flow to the "status" of the wall.
I tried rasing the conductancy if the wall gets removed, but it seems as it isn't possible to change this parameter during simulaiton.
My other approach was to add a separate heat flow connection and only connect the ports if the wall is opened.
Lastly I tried setting the Qflow variable of one of the ports.

Unfortunately I didn't get any of these ideas to work.

Can someone tell me what's the best way to solve my problem?
Otherwise it might be really helpful if you have a link or something to a tutorial how to make optional connections.
(I could only find information regarding optional components, but this isn't helpful, or is it?).

Regards,
Magnus

Re: Optional / Conditional Heat Flow

Hey,
as far as I know, it is not possible to make optional connections with an connect-equation. You can try to overcome this problem by making all the connection equations yourself and setting the if-branch in each of them.

Re: Optional / Conditional Heat Flow

You can make a variable thermal conductor, instead of just using the fixed one.  For an idea about how this might work, compare Modelica.Electrical.Analog.Basic.Resistor and Modelica.Electrical.Analog.Basic.VariableResistor.

You can copy ThermalConductor and then make a variable version, like this:


model VarThermalConductor
  extends Modelica.Thermal.HeatTransfer.Interfaces.Element1D;
  Modelica.Blocks.Interfaces.RealInput G "Constant thermal conductance of material";
equation
  Q_flow = G * dT;
end VarThermalConductor;



Then, you can just connect an input to G and vary that with another block as you want.

There are 0 guests and 0 other users also viewing this topic
You are here: