Description: "Package that tests the models for coupled simulation between Modelica and Fast Fluid Dynamics"

- Home > Modelica

## Buildings.Rooms.Examples.FFD

Package that tests the models for coupled simulation between Modelica and Fast Fluid Dynamics

### Information

This package tests the coupled simulation of the model Buildings.Rooms.CFD with the Fast Fluid Dynamics (FFD) program. Different cases with various boundary conditions are evaluated. The models in this package do not represent realistic buildings, but are rather designed to test the coupled simulation.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

### Package Content

Name | Description
--- | ---
UsersGuide |
Tutorial | Tutorial with step by step instructions for how to do coupled simulation
ForcedConvection | Ventilation with forced convection in an empty room
NaturalConvectionWithControl | A case of natural convection with feedback loop control
RoomOnlyConstructionBoundary | Test model for natural convection in an empty room with only construction boundary.
RoomOnlyExteriorWallNoWindow | Natural convection in an empty room with only exterior walls without windows.
RoomOnlySurfaceBoundary | Natural convection in an empty room with only surface boundary
WindowWithShade | Natural convection in an empty room with exterior walls, windows and shades
WindowWithoutShade | Natural convection in an empty room with exterior walls, windows without shade
BaseClasses | Package with base classes for Buildings.Rooms.Examples.FFD

## Buildings.Rooms.Examples.FFD.ForcedConvection

Ventilation with forced convection in an empty room

### Information

This model tests the coupled simulation of Buildings.Rooms.CFD with the FFD program by simulating the ventilation with forced convection in an empty room. Figure (a) shows the schematic of the FFD simulation and Figure (b) shows streamlines and contours of the horizontal velocity U as simulated by the FFD.

Figure (a)

Figure (b)

Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Rooms.Examples.FFD.BaseClasses.PartialRoom (Partial model for a room).

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Integer | nConExtWin | 0 | Number of constructions with a window
Integer | nConBou | 0 | Number of surface that are connected to constructions that are modeled inside the room
Integer | nSurBou | 6 | Number of surface that are connected to the room air volume
Integer | nConExt | 0 | Number of exterior constructions withour a window
Integer | nConPar | 0 | Number of partition constructions

### Modelica definition

model ForcedConvection "Ventilation with forced convection in an empty room" extends Modelica.Icons.Example; extends Buildings.Rooms.Examples.FFD.BaseClasses.PartialRoom( roo( surBou( name={"East Wall","West Wall","North Wall","South Wall","Ceiling","Floor"}, A={0.9,0.9,1,1,1,1}, til={Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Ceiling, Buildings.Types.Tilt.Floor}, each absIR=1e-5, each absSol=1e-5, each boundaryCondition= Buildings.Rooms.Types.CFDBoundaryConditions.Temperature), nPorts=2, portName={"Inlet","Outlet"}, cfdFilNam="modelica://Buildings/Resources/Data/Rooms/FFD/ForcedConvection.ffd", samplePeriod=6, linearizeRadiation=true, massDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial), nSurBou=6); HeatTransfer.Sources.FixedTemperature TWal[nSurBou](each T=283.15) "Temperature of other walls"; Fluid.Sources.FixedBoundary bouOut(nPorts=1, redeclare package Medium = MediumA); Fluid.Sources.MassFlowSource_T bounIn( nPorts=1, redeclare package Medium = MediumA, m_flow=0.01, T=283.15); equation for i in 1:nSurBou loop connect(TWal[i].port, roo.surf_surBou[i]); end for; connect(bounIn.ports[1], roo.ports[1]); connect(bouOut.ports[1], roo.ports[2]); end ForcedConvection;

## Buildings.Rooms.Examples.FFD.NaturalConvectionWithControl

A case of natural convection with feedback loop control

### Information

This model tests the coupled simulation of Buildings.Rooms.CFD with the FFD program by simulating natural convection in an empty room with a PI controller and a heater to maintain the temperature at room center to be 2ˆC.

The configuration of the simulation is the same as Buildings.Rooms.Examples.FFD.Tutorial.NaturalConvection, except that a heater with PI controller is added to maintain the desired room temperature.

The temperature at the central room is sent to the PI controller as measured temperature. Based on the difference of set temperature and measured temperaure PI controller sends signal to the heater to yield the heat flow. The heat flow is then injected into the room through the heat port as convective heat flow. After receving the heat flow from Modelica, the FFD uniformly distributes it into the space.

Figure (a) shows the velocity vectors and temperature contours in degree Celsius on the X-Z plane at Y = 0.5 m as simulated by the FFD.

Figure (a)

Extends from Buildings.Rooms.Examples.FFD.Tutorial.NaturalConvection (Tutorial for Natural Convection case).

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Integer | nConExtWin | 0 | Number of constructions with a window
Integer | nConBou | 0 | Number of surface that are connected to constructions that are modeled inside the room
Integer | nSurBou | 6 | Number of surface that are connected to the room air volume
Integer | nConExt | 0 | Number of exterior constructions withour a window
Integer | nConPar | 0 | Number of partition constructions

### Modelica definition

model NaturalConvectionWithControl "A case of natural convection with feedback loop control" extends Buildings.Rooms.Examples.FFD.Tutorial.NaturalConvection( roo( nPorts=0, useCFD=true, samplePeriod=30, cfdFilNam = "modelica://Buildings/Resources/Data/Rooms/FFD/NaturalConvectionWithControl.ffd", massDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)); HeatTransfer.Sources.PrescribedHeatFlow preHeatFlo; Controls.Continuous.LimPID conPID( yMin=0, controllerType=Modelica.Blocks.Types.SimpleController.PI, Ti=120, yMax=1, k=0.001); Modelica.Blocks.Sources.Constant TSet(k=275.15) "Temperature set point"; equation connect(roo.yCFD[1], conPID.u_m); connect(TSet.y, conPID.u_s); connect(preHeatFlo.port, roo.heaPorAir); connect(conPID.y, preHeatFlo.Q_flow); end NaturalConvectionWithControl;

## Buildings.Rooms.Examples.FFD.RoomOnlyConstructionBoundary

Test model for natural convection in an empty room with only construction boundary.

### Information

This model tests the copuled simulation of Buildings.Rooms.CFD with the FFD program by simulating the natural convection in an empty room with only construction boundaries.

Figure (a) shows the schematic of the FFD simulation. The room is 1 meter in length, width and height. The temperature of the east wall is set to 40ˆC and the rest walls are at 10ˆC. The initial value for the temperature of the room air is 30ˆC. Two sensors are placed in the room center at (0.5 m, 0.5 m, 0.5 m) that measure the temperature and the velocity.

Figure (a)

Figure (b) shows the velocity vectors and temperature contours in degree Celsius on the X-Z plane at Y = 0.5 m as simulated by the FFD.

Figure (b)

Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Rooms.Examples.FFD.BaseClasses.PartialRoom (Partial model for a room).

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Generic | matLayWal |  | Construction material for all the envelopes
Integer | nConExtWin | 0 | Number of constructions with a window
Integer | nConBou | 6 | Number of surface that are connected to constructions that are modeled inside the room
Integer | nSurBou | 0 | Number of surface that are connected to the room air volume
Integer | nConExt | 0 | Number of exterior constructions withour a window
Integer | nConPar | 0 | Number of partition constructions

### Modelica definition

model RoomOnlyConstructionBoundary "Test model for natural convection in an empty room with only construction boundary." extends Modelica.Icons.Example; parameter Buildings.HeatTransfer.Data.OpaqueConstructions.Generic matLayWal( final nLay=1, material={HeatTransfer.Data.Solids.Steel(x=0.001)}, roughness_a=Buildings.HeatTransfer.Types.SurfaceRoughness.Smooth) "Construction material for all the envelopes"; extends Buildings.Rooms.Examples.FFD.BaseClasses.PartialRoom( roo( datConBou( name={"East Wall","West Wall","North Wall","South Wall","Floor","Ceiling"}, layers={matLayWal,matLayWal,matLayWal,matLayWal,matLayWal,matLayWal}, each A=1*1, til={Buildings.Types.Tilt.Wall,Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall,Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Floor,Buildings.Types.Tilt.Ceiling}, boundaryCondition={Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature,Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature,Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature}), homotopyInitialization=false), nConBou=6); Buildings.HeatTransfer.Sources.FixedTemperature TWalRes[nConBou - 1]( each T=283.15) "Boundary condition for the other walls"; HeatTransfer.Sources.FixedTemperature TEasWal(each T=313.15) "Temperature of the east wall"; equation for i in 1:nConBou - 1 loop connect(TWalRes[i].port, roo.surf_conBou[i + 1]); end for; connect(TEasWal.port, roo.surf_conBou[1]); end RoomOnlyConstructionBoundary;

## Buildings.Rooms.Examples.FFD.RoomOnlyExteriorWallNoWindow

Natural convection in an empty room with only exterior walls without windows.

### Information

This model tests the coupled simulation of Buildings.Rooms.CFD with the FFD program by simulating the natural convection in an empty room with only exterior walls and without windows.

Figure (a) shows the schematic of the FFD simulation. The room is 1 meter in length, width and height. The walls are exposed to the ambient environment (cold winter night in Chicago) and the insulation is very poor. The initial values are for the temperatures of the walls 20ˆC and for temperature of the air 30ˆC. All temperature drop quickly due to the heat loss. Two sensors are placed in the room center at (0.5 m, 0.5 m, 0.5 m) that measure the temperature and the velocity.

Figure (a)

Figure (b) shows the velocity vectors and temperature contours in degree Celsius on the X-Z plane at Y = 0.5 m as simulated by the FFD. In the cold mid-night of Chicago, the temperature of the ceiling is the lowest and the temperature of the ground floor is the highest.

Figure (b)

Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Rooms.Examples.FFD.BaseClasses.PartialRoom (Partial model for a room).

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Generic | matLayWal |  | Construction material for all the envelopes
Integer | nConExtWin | 0 | Number of constructions with a window
Integer | nConBou | 0 | Number of surface that are connected to constructions that are modeled inside the room
Integer | nSurBou | 0 | Number of surface that are connected to the room air volume
Integer | nConExt | 6 | Number of exterior constructions withour a window
Integer | nConPar | 0 | Number of partition constructions

### Modelica definition

model RoomOnlyExteriorWallNoWindow "Natural convection in an empty room with only exterior walls without windows." extends Modelica.Icons.Example; parameter Buildings.HeatTransfer.Data.OpaqueConstructions.Generic matLayWal( final nLay=1, material={HeatTransfer.Data.Solids.Steel(x=0.001)}, roughness_a=Buildings.HeatTransfer.Types.SurfaceRoughness.Smooth) "Construction material for all the envelopes"; extends Buildings.Rooms.Examples.FFD.BaseClasses.PartialRoom( nConExt=6, nConExtWin=0, nConPar=0, nConBou=0, nSurBou=0, roo(nConExt=nConExt, datConExt( name={"East Wall","West Wall","North Wall","South Wall","Floor","Ceiling"}, layers={matLayWal,matLayWal,matLayWal,matLayWal,matLayWal,matLayWal}, each A=1*1, til={Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Floor, Buildings.Types.Tilt.Ceiling}, boundaryCondition={ Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature}), samplePeriod=30)); end RoomOnlyExteriorWallNoWindow;

## Buildings.Rooms.Examples.FFD.RoomOnlySurfaceBoundary

Natural convection in an empty room with only surface boundary

### Information

This model tests the coupled simulation of Buildings.Rooms.CFD with the FFD program by simulating the natural convection in an empty room with only surface boundaries. It is also used to test the adiabatic boundary conditon in the FFD code.

Figure (a) shows the schematic of the FFD simulation. The following conditions are applied in the Modelica model:

- East Wall: Fixed temperature at 40ˆC,
- West Wall: Fixed temperature at 10ˆC,
- North and South Wall, Ceiling, Floor: Fixed heat flux at 0 W/m2.

Figure (a)

Figure (b) shows the velocity vectors and temperature contours in degree Celsius on the X-Z plane at Y = 0.5 m as simulated by the FFD.

Figure (b)

Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Rooms.Examples.FFD.BaseClasses.PartialRoom (Partial model for a room).

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Integer | nConExtWin | 0 | Number of constructions with a window
Integer | nConBou | 0 | Number of surface that are connected to constructions that are modeled inside the room
Integer | nSurBou | 6 | Number of surface that are connected to the room air volume
Integer | nConExt | 0 | Number of exterior constructions withour a window
Integer | nConPar | 0 | Number of partition constructions

### Modelica definition

model RoomOnlySurfaceBoundary "Natural convection in an empty room with only surface boundary" extends Modelica.Icons.Example; extends Buildings.Rooms.Examples.FFD.BaseClasses.PartialRoom(roo( linearizeRadiation=false, samplePeriod=60, surBou( name={"East Wall","West Wall","North Wall","South Wall","Floor","Ceiling"}, each A=1*1, til={Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Floor, Buildings.Types.Tilt.Ceiling}, each absIR=1e-5, each absSol=1e-5, boundaryCondition={ Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.HeatFlowRate, Buildings.Rooms.Types.CFDBoundaryConditions.HeatFlowRate, Buildings.Rooms.Types.CFDBoundaryConditions.HeatFlowRate, Buildings.Rooms.Types.CFDBoundaryConditions.HeatFlowRate})), nSurBou=6); Buildings.HeatTransfer.Sources.FixedTemperature TWesWal(each T=283.15) "Boundary condition for the west wall"; HeatTransfer.Sources.FixedHeatFlow fixedHeatFlow[nSurBou - 2](each Q_flow=0); HeatTransfer.Sources.FixedTemperature TEasWal(each T=313.15) "Temperature of the east wall"; equation for i in 1:nSurBou - 2 loop connect(fixedHeatFlow[i].port, roo.surf_surBou[i+2]); end for; connect(TEasWal.port, roo.surf_surBou[1]); connect(TWesWal.port, roo.surf_surBou[2]); end RoomOnlySurfaceBoundary;

## Buildings.Rooms.Examples.FFD.WindowWithShade

Natural convection in an empty room with exterior walls, windows and shades

### Information

This model tests the cosimulation of Buildings.Rooms.CFD with the FFD program by simulating natural convection in a room with only exterior walls and windows with shades.

Figure (a) show the schematic of FFD simulation. The walls and the windows are exposed to the ambient environment. The wall is well insulated and the initial temperature is 20ˆC. The initial temperature for the room air is 17ˆC.

Figure (a)

Figure (b) shows the velocity vectors and temperature contours in degree Celsius on the X-Z plane at Y = 0.5 m, at t = 300 s as simulated by the FFD.

Figure (b)

Note: The current version of the FFD program does not support a moving boundary. Thus, the shade can only be at a fixed position as determined by the parameter `uSha_fixed={0.5,0.5}`.

Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Rooms.Examples.FFD.BaseClasses.PartialRoom (Partial model for a room).

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Integer | nConExtWin | 2 | Number of constructions with a window
Integer | nConBou | 0 | Number of surface that are connected to constructions that are modeled inside the room
Integer | nSurBou | 0 | Number of surface that are connected to the room air volume
Integer | nConExt | 4 | Number of exterior constructions withour a window
Integer | nConPar | 0 | Number of partition constructions
Insulation100Concrete200 | matLayExt |  | Construction material for exterior walls
DoubleClearAir13Clear | glaSys |  | Data record for the glazing system

### Modelica definition

model WindowWithShade "Natural convection in an empty room with exterior walls, windows and shades" extends Modelica.Icons.Example; extends Buildings.Rooms.Examples.FFD.BaseClasses.PartialRoom( nConExt=4, nConExtWin=2, nConPar=0, nConBou=0, nSurBou=0, roo( nConExt=nConExt, nConExtWin=nConExtWin, datConExt( name={"North Wall","South Wall","Floor","Ceiling"}, each A=1, layers={matLayExt,matLayExt,matLayExt,matLayExt}, til={ Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Floor, Buildings.Types.Tilt.Ceiling}, boundaryCondition={ Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature}), datConExtWin( name={"East Wall","West Wall"}, layers={matLayExt,matLayExt}, each A=1, glaSys={glaSys,glaSys}, each wWin=1, each hWin=0.5, each fFra=0.2, til={ Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall}, azi={ Buildings.Types.Azimuth.E, Buildings.Types.Azimuth.W}, boundaryCondition={ Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature}), uSha_fixed={0.5,0.5}, samplePeriod=10, linearizeRadiation=true, cfdFilNam="modelica://Buildings/Resources/Data/Rooms/FFD/WindowWithShade.ffd")); parameter HeatTransfer.Data.OpaqueConstructions.Insulation100Concrete200 matLayExt "Construction material for exterior walls"; parameter HeatTransfer.Data.GlazingSystems.DoubleClearAir13Clear glaSys(UFra=2, shade=Buildings.HeatTransfer.Data.Shades.Gray(), haveExteriorShade=false, haveInteriorShade=true) "Data record for the glazing system"; end WindowWithShade;

## Buildings.Rooms.Examples.FFD.WindowWithoutShade

Natural convection in an empty room with exterior walls, windows without shade

### Information

This model tests the coupled simulation of Buildings.Rooms.CFD with the FFD program by simulating natural convection in a room with only exterior walls and windows.

Figure (a) shows the schematic of FFD simulation. The walls are exposed to the ambient environment. Both the wall and window are well insulated and the initial temperature of the walls and the window is 20ˆC.

Figure (a)

Figure (b) shows the velocity vectors and temperature contour in degree Celsius on the X-Z plane at Y = 0.5 m as simulated by the FFD.

Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Rooms.Examples.FFD.BaseClasses.PartialRoom (Partial model for a room).

### Parameters

Type | Name | Default | Description
--- | --- | --- | ---
Integer | nConExtWin | 2 | Number of constructions with a window
Integer | nConBou | 0 | Number of surface that are connected to constructions that are modeled inside the room
Integer | nSurBou | 0 | Number of surface that are connected to the room air volume
Integer | nConExt | 4 | Number of exterior constructions withour a window
Integer | nConPar | 0 | Number of partition constructions
Insulation100Concrete200 | matLayExt |  | Construction material for exterior walls
DoubleClearAir13Clear | glaSys |  | Data record for the glazing system

### Modelica definition

model WindowWithoutShade "Natural convection in an empty room with exterior walls, windows without shade" extends Modelica.Icons.Example; extends Buildings.Rooms.Examples.FFD.BaseClasses.PartialRoom( nConExt=4, nConExtWin=2, nConPar=0, nConBou=0, nSurBou=0, roo( nConExt=nConExt, nConExtWin=nConExtWin, datConExt( name={"North Wall","South Wall","Floor","Ceiling"}, each A=1, layers={matLayExt,matLayExt,matLayExt,matLayExt}, til={Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Floor, Buildings.Types.Tilt.Ceiling}, boundaryCondition={ Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature}), datConExtWin( name={"East Wall","West Wall"}, layers={matLayExt,matLayExt}, each A=1, glaSys={glaSys,glaSys}, each wWin=1, each hWin=0.5, each fFra=0.2, til={ Buildings.Types.Tilt.Wall, Buildings.Types.Tilt.Wall}, azi={ Buildings.Types.Azimuth.E, Buildings.Types.Azimuth.W}, boundaryCondition={ Buildings.Rooms.Types.CFDBoundaryConditions.Temperature, Buildings.Rooms.Types.CFDBoundaryConditions.Temperature}), cfdFilNam="modelica://Buildings/Resources/Data/Rooms/FFD/WindowWithoutShade.ffd", uSha_fixed={0, 0})); parameter HeatTransfer.Data.OpaqueConstructions.Insulation100Concrete200 matLayExt "Construction material for exterior walls"; parameter HeatTransfer.Data.GlazingSystems.DoubleClearAir13Clear glaSys(UFra=2, shade=Buildings.HeatTransfer.Data.Shades.Gray(), haveExteriorShade=false, haveInteriorShade=false) "Data record for the glazing system"; end WindowWithoutShade;