modelMixedConvection

Tutorial for Mixed Convection case

Extends from Modelica.Icons.Example (Icon for runnable examples).

Information

This tutorial gives step by step instructions on building and simulating a mixed convection model. The model tests the coupled simulation of Buildings.ThermalZones.Detailed.CFD with the FFD program by simulating ventilation with mixed convection in an empty room.

Case Description

The temperature of the floor is fixed at 30°C and the temperature of the walls and the ceiling are fixed at 10°C. The supply air temperature is fixed at 10°C.

Figure (a) shows the schematic of the FFD simulation and Figure (b) shows the velocity vectors and temperatures on the X-Z plane at Y = 0.5 m as simulated by the FFD.

image

Figure (a)

image

Figure (b)

Step by Step Guide

This section describes step by step how to build and simulate the model.

  1. Add the following model components into the MixedConvection model:

  2. In the textual editor mode, add the medium and the number of surfaces as below:

    package MediumA = Buildings.Media.GasesConstantDensity.MoistAirUnsaturated (T_default=283.15);
      parameter Integer nConExtWin=0;
      parameter Integer nConBou=0;
      parameter Integer nSurBou=6;
      parameter Integer nConExt=0;
      parameter Integer nConPar=0;
    
  3. Edit roo as below:

    Buildings.ThermalZones.Detailed.CFD roo(
      redeclare package Medium = MediumA,
      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.ThermalZones.Detailed.Types.CFDBoundaryConditions.Temperature),
        AFlo = 1*1,
        hRoo = 1,
        linearizeRadiation = false,
        useCFD = true,
        sensorName = {"Occupied zone air temperature", "Velocity"},
        cfdFilNam = "resources/Buildings/Resources/Data/ThermalZones/Detailed/Examples/FFD/Tutorial/MixedConvection.ffd",
        nConExt = nConExt,
        nConExtWin = nConExtWin,
        nConPar = nConPar,
        nConBou = nConBou,
        nSurBou = nSurBou,
        nPorts = 2,
        portName={"Inlet","Outlet"},
        samplePeriod = 6);
    
  4. Set the parameters for the following components:

    • Set qRadGai_flow, qConGai_flow and qLatGai_flow to 0.
    • Set TFlo to 303.15 Kelvin.
    • Set TOthWal to 283.15 Kelvin.
  5. Set the values for the parameters of bouIn and bouOut as below:

    Fluid.Sources.MassFlowSource_T bouIn(
      redeclare package Medium = MediumA,
      nPorts=1,
      m_flow=0.1,
      T=283.15);
    
    Fluid.Sources.FixedBoundary bouOut(
      redeclare package Medium = MediumA,
      nPorts=1);
    
  6. Connect the components as shown in the figure below.

    image

  7. Confirm in the textual editor that the connections to roo.ports are as follows:

    connect(bouIn.ports[1], roo.ports[1]);
    connect(bouOut.ports[1], roo.ports[2]);
    
  8. Use the Simplified CFD Interface (SCI) to generate the input file for the FFD.

    • Use a 20 X 20 X 20 stretched grid.
    • Set the time step size of the FFD to 0.1 seconds.
    • Generate the input files, which have by default the names input.cfd (mesh file) and zeroone.dat (obstacles file).
    • Rename the files as MixedConvection.cfd and MixedConvection.dat, respectively.
  9. Revise the FFD parameter input file MixedConvection.ffd (an example file is available in Buildings/Resources/Data/ThermalZones/Detailed/Examples/FFD/Tutorial/):

      inpu.parameter_file_format SCI
      inpu.parameter_file_name MixedConvection.cfd
      inpu.block_file_name MixedConvection.dat
      prob.nu 0.000015 // Kinematic viscosity
      prob.rho 1.205 // Density
      prob.gravx 0 // Gravity in x direction
      prob.gravy 0 // Gravity in y direction
      prob.gravz -9.81 // Gravity in z direction
      prob.cond 0.0257 // Conductivity
      prob.Cp 1006.0 // Specific heat capacity
      prob.beta 0.00343 // Thermal expansion coefficient
      prob.diff 0.00001 // Diffusivity for contaminants
      prob.coeff_h 0.0004 // Convective heat transfer coefficient near the wall
      prob.Temp_Buoyancy 10.0 // Reference temperature for calculating buoyance  force
      init.T 10.0 // Initial condition for Temperature
      init.u 0.0 // Initial condition for velocity u
      init.v 0.0 // Initial condition for velocity v
      init.w 0.0 // Initial condition for velocity w
    
  10. Put the files MixedConvection.ffd, MixedConvection.dat, and MixedConvection.cfd in the directory Buildings/Resources/Data/ThermalZones/Detailed/Examples/FFD/Tutorial/.
  11. Set the simulation stop time of the Modelica model to 180 seconds and choose, for example, the CVode solver.
  12. Translate the model and start the simulation.
  13. Post-process: click the Tecplot macro script Buildings/Resources/Image/Rooms/Examples/FFD/Tutorial/MixedConvection.mcr that will generate the temperature contour and velocity vectors shown in the Figure (b). Note: Tecplot is needed for this.

Parameters

TypeNameDefaultDescription
IntegernConExtWin0Number of constructions with a window
IntegernConBou0Number of surface that are connected to constructions that are modeled inside the room
IntegernSurBou6Number of surface that are connected to the room air volume
IntegernConExt0Number of exterior constructions withour a window
IntegernConPar0Number of partition constructions

Components

TypeNameDefaultDescription
Modelica.Blocks.Sources.ConstantqRadGai_flowRadiative heat gain
Modelica.Blocks.Sources.ConstantqConGai_flowConvective heat gain
Modelica.Blocks.Sources.ConstantqLatGai_flowLatent heat gain
Modelica.Blocks.Routing.Multiplex3multiplex3_1
BoundaryConditions.WeatherData.ReaderTMY3weaDat
Buildings.ThermalZones.Detailed.CFDroo
HeatTransfer.Sources.FixedTemperature[nSurBou - 1]TOthWalTemperature for other walls
HeatTransfer.Sources.FixedTemperatureTFloTemperature of floor
Fluid.Sources.MassFlowSource_TbouInMass flow boundary condition
Buildings.Fluid.Sources.Boundary_pTbouOutPressure boundary condition

Contents

NameDescription
MediumAMedium model

Revisions

  • September 16, 2021, by Michael Wetter:
    Removed assignment of parameter lat as this is now obtained from the weather data reader.
    This is for IBPSA, #1477.
  • September 07, 2017, by Thierry Nouidui:
    Refactored the FFD C-code and revised the documentation. This is for issue 612.
  • July 25, 2014, by Michael Wetter:
    Revised documentation.
  • June 27, 2014, by Wei Tian, Thomas Sevilla, Wangda Zuo:
    First implementation.