How to specify medium in Openmodelica? - modelica

I am simulating a heat pump water heating system in Modelica. I have attached the picture of my model. However, when I run the model I get the error "Medium is partial, name lookup is not allowed in partial classes". Can you please let me know:
How should I specify the water in tank, heat pump condenser and pipe?
How should I specify air in heat pump evaporator?
And in general, I did not find any example of modeling thermal systems in Openmodelica, can you suggest a source?
Thanks

Related

Modelica : Simulation of temperature rise in a cable - How to do?

I am a beginner on modelica. I wanted to transpose a model found on a paper (on internet) to a modelica model.
Here is the paper :
Insulated Cable Temperature Calculation and Numerical Simulation
I am stuck in rewritting the fomulas. Second derivative on a variable different of time --> i don't know how to do.
Another way I was thinking is to use the Thermal/HeatTransfer library. But here too, I don't know how to put the blocks togethers... I think this is due to a big lack in thermodynamic knowledge from my side.
--> I don't know what block to use to simulate the conductor and the insulation layer.
Maybe this is something too difficult ?
If someone has an idea on how to start, it will be a pleasure to read you :)
I tried to use the Thermal library :
Using heat transfert lib.
I have a current source and a resistance.
The resistance will change depending on the temperature involved by the current in the resistance.
I use 0.004 as alpha for the relationship R=R20*(1+alpha(T-Tamb)).
Let's say I have a 1 meter copper conductor with a crossSection of S=16mm² = 15.10^-6m²
then the initial resistance is R = rho.L/S ≃ 1.07mΩ at 20°C
Following this example of cable : Bayka 16mm²
To get 70°C at the surface of the conductor, then the max current for a single 16mm² wire cable is 107A in air, and 160A in earth.
I took, in my example, random value of thermal conductance and capacity to get an approximative temperature near the one given in the table (~70°C).
Is this model is the good one for an insulated cable ? (no considering values)
Or I forgot something? Maybe I am wrong in the position of the blocks ?
What do you think ?
Looks reasonable to me, might be easier to use the same component for heat conduction (heat resistor or heat conductance, not both) in order to be able to compare the two values. The mathematical formulas for radial heat conduction can be found here e.g. https://web2.clarkson.edu/projects/subramanian/ch330/notes/Conduction%20in%20the%20Cylindrical%20Geometry.pdf

Error: "The model is structurally singular" Dymola Modelica Solar thermal coupled with hot water tank and floor heating

Here what I am doing is that using the weather data as input parameter, if the global radiation is higher than 100 W/m^2 open the valve. First solar heat will be released to the hot water tank, and then the heat will be given to the Boundry_pT via heat exchanger. I want to see, how the temperature of Boundry_pt changes resp. time.
I also want to use water as Medium in the internal heat exchanger. For that I edited the text box in Medium in the heat exchanger, as Buildings_Media_Water. Is it correct? Otherweise how can I choose water as a medium in the internal heat exchanger?
It seems that you have two separate fluid-circuits, and you only have one expansion tank (the "exp" component - sorry if I don't have the right terminology).
That means that the flow becomes over-determined in the 2nd circuit - and the pressure under-determined. There are a number of ways of handling it - including adding an expansion tank.

Heat Regeneration in Dymola/Modelica

I want to build a system which consists of solar thermal collectors and ground source heat exchanger. I have a whole season weather data, which is connected with solar thermal collectors. I want to see how much heat will be released during the whole season from solar collectors to the ground by ground source heat exchanger respectively borehole, and the increased ground temperature by heat release.
Although I have the same number of unknowns and equations, the singularity error comes up.
Is there any missing process element?
The thermo-hydraulic part of your model needs a "ground" component to provide the reference pressure and enthalpy, since the heat exchanger components only describe changes in pressure/enthalpy.
You could use, e.g., a Modelica.Fluid.Sources.Boundary_pT, Modelica.Fluid.Sources.Boundary_ph or Buildings.Fluid.Storage.ExpansionVessel component for that.

Change hydraulic block to gas block Simscape

I am creating a Simscape gas model where I need to use 3 way directional valves. Unfortunately there are no directional valves in the gas library. I used the 3 way directional valves from the hydraulic library but I get dashed red lines when I try to connect the valve to the other gas components. Is there a way of converting a hydraulic block to a gas block in Simulink/Simscape?
Edit: Added image of model
As #Wolfie has indicated, you can't connect a hydraulic component to a gas component, they are two completely different physical domains. To recap and add to what your options are:
Combine Simscape blocks to create your own model of a directional valve in the gas domain. There is an example of that in the Pneumatic Actuation Circuit example:
Use the Simscape language to create your own block of a gas directional valve.
Use Simulink to Physical Signal and Physical Signal to Simulink blocks to interface your Simscape model to your model of the gas directional valve created in Simulink. Probably not as good a solution (even though it's potentially easier), as you lose the acausality that Simscape provides by going back into Simulink.

modeling a multi-phase mixture of mediums in Modelica

Is there a systematic way of defining a water medium with minimal complexity (fixed heat capacity, fixed latent heats, fixed vapor pressure curves) that can be used to capture a three-phase pseudo-equilibrium dynamics in Modelica?
My ultimate usage scenario involves modeling simple air in the mixture as well and I am fairly confident in using air and liquid water together and have used a simple non-medium approach to deal with liquid and vapor but not through the medium models and suspect that I could capture the basic physics involved.