I'm really new to OpenModelica. I'm a student and most of the time I used Finite elements softawres. I'm currently in my final intership and have to use OpenModelica to model a system. No one in the company is currently using it so they can't really help me about the tool.
So here I'm trying to model a fluid flowing through a pipe (forced convection) surrounded by another fluid called fluid2 (convection). Around fluid2, we have ambient condition with fixed temperature, and I consider conduction in the wall between ambient and fluid2 which will create an heat flux between the ambient and fluid 2. Here's a picture to show the configuration :
My model looks like this :
model BT_V4
//Define the properties of Fluid1 and Fluid2
replaceable package Medium=Modelica.Media.Water.StandardWater constrainedby
Modelica.Media.Interfaces.PartialMedium;
//Define the type of heat transfer for forced convection
replaceable model HeatTransfer_1 =
Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.LocalPipeFlowHeatTransfer;
//Define the flow for pressure loss
replaceable model FlowModel_1 =
Modelica.Fluid.Pipes.BaseClasses.FlowModels.DetailedPipeFlow;
inner Modelica.Fluid.System system;
//Definition of Fluid1
Modelica.Fluid.Pipes.DynamicPipe pipe(redeclare package Medium = Medium, redeclare final model HeatTransfer = HeatTransfer_1, redeclare final model FlowModel = FlowModel_1, T_start = 318.15, diameter = 12.8e-3, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyState, length = 15, massDynamics = Modelica.Fluid.Types.Dynamics.SteadyState, momentumDynamics = Modelica.Fluid.Types.Dynamics.SteadyState, nNodes = 10, nParallel = 1, p_a_start = 14.6e5, use_HeatTransfer = true);
//Definition of Fluid2
Modelica.Fluid.Pipes.DynamicPipe pipe1(redeclare package Medium = Medium, redeclare final model HeatTransfer = HeatTransfer_1, redeclare final model FlowModel = FlowModel_1, T_start = 328.15, diameter = 12.8e-3, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyState, length = 15, massDynamics = Modelica.Fluid.Types.Dynamics.SteadyState, momentumDynamics = Modelica.Fluid.Types.Dynamics.SteadyState, nNodes = 10, nParallel = 1, p_a_start = 14.6e5, use_HeatTransfer = true);
//Define the properties of the wall of the tube of Fluid1
Modelica.Fluid.Examples.HeatExchanger.BaseClasses.WallConstProps wallConstProps( T_start = 318.15,area_h = 0.89535390627, c_wall = 510, dT = 273.15, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyState, k_wall = 60.5, n = 10, rho_wall = 7850, s = 6e-3);
//Inlet limit conditions for Fluid1
Modelica.Fluid.Sources.Boundary_pT boundary(redeclare package Medium = Medium,T = 318.15, nPorts = 1, p = 14.6e5);
//Outlet limit conditions for Fluid1
Modelica.Fluid.Sources.Boundary_pT boundary1(redeclare package Medium = Medium,T = 328.15, p = 14e5, nPorts = 1);
//Inlet limit conditions for Fluid2
Modelica.Fluid.Sources.Boundary_pT boundary2(redeclare package Medium = Medium, T = 328.15,nPorts = 1, p = 14.6e5);
//Outlet limit conditions for Fluid2
Modelica.Fluid.Sources.Boundary_pT boundary3(redeclare package Medium = Medium, T = 328.15,nPorts = 1, p = 14e5);
//Convection around the tube (between the wall and Fluid2)
Modelica.Thermal.HeatTransfer.Components.Convection[pipe.nNodes] convection;
Modelica.Blocks.Sources.Constant[pipe.nNodes] const(each k = 179);
//Heat transfer between the ambient and Fluid2
Modelica.Thermal.HeatTransfer.Components.ThermalConductor[pipe.nNodes] conductor(each G=10);
Modelica.Thermal.HeatTransfer.Sources.FixedTemperature[pipe.nNodes] fixedTemp(each T=293.15);
equation
connect(boundary.ports[1], pipe.port_a);
connect(pipe.port_b, boundary1.ports[1]);
connect(boundary2.ports[1], pipe1.port_a);
connect(pipe1.port_b, boundary3.ports[1]);
connect(wallConstProps.heatPort_b, pipe.heatPorts);
connect(convection.fluid,pipe1.heatPorts);
connect(convection.solid,wallConstProps.heatPort_a);
connect(const.y,convection.Gc);
connect(conductor.port_a,fixedTemp.port);
connect(conductor.port_b,pipe1.heatPorts);
end BT_V4;
My model is running. I also didn't really consider proper values for some parameters. I just wanted to see if the model was running. I don't have access to another software right now (and for some time) to compare the results and see if the model is correct.
Can I have your opinion is this model a correct way to simulate my problem in a physical point of view ?
Best regards, Maxime