Formation Otrera #2
20
Formation/OTRERA_formation/Models/Test_Media.mo
Normal file
20
Formation/OTRERA_formation/Models/Test_Media.mo
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
within OTRERA_formation.Models;
|
||||||
|
|
||||||
|
|
||||||
|
model Test_Media
|
||||||
|
replaceable package Medium = Modelica.Media.Air.MoistAir constrainedby Modelica.Media.Interfaces.PartialMedium annotation(choicesAllMatching = true) ;
|
||||||
|
//USER DEFINED PARAMETERS
|
||||||
|
parameter Modelica.Units.SI.Temperature T = 573.15 ;
|
||||||
|
parameter Modelica.Units.SI.Pressure p = 155e5 ;
|
||||||
|
//INTERNAL VARIABLES
|
||||||
|
Medium.ThermodynamicState state ;
|
||||||
|
Modelica.Units.SI.Density d ;
|
||||||
|
|
||||||
|
//IMPORTED COMPONENTS
|
||||||
|
|
||||||
|
equation
|
||||||
|
state = Medium.setState_pTX(p=p,T=T);
|
||||||
|
d = Medium.density(state) ;
|
||||||
|
|
||||||
|
|
||||||
|
end Test_Media;
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
within OTRERA_formation.Models;
|
||||||
|
|
||||||
|
model Test_replaceable_media
|
||||||
|
Test_Media test_Media(T = 623.15, p = 1.4e7, redeclare package Medium = Modelica.Media.Water.WaterIF97_R1pT) annotation(
|
||||||
|
Placement(transformation(origin = {2, 6}, extent = {{-10, -10}, {10, 10}})));
|
||||||
|
equation
|
||||||
|
|
||||||
|
end Test_replaceable_media;
|
||||||
@@ -1 +1,5 @@
|
|||||||
Coupled_model
|
Coupled_model
|
||||||
|
Coupled_model_prescribed
|
||||||
|
Coupled_model_prescribed_variable
|
||||||
|
Test_Media
|
||||||
|
Test_replaceable_media
|
||||||
|
|||||||
Reference in New Issue
Block a user