Buildings.Fluid.Geothermal.Borefields.TOUGH.BaseClasses
Base classes used in Buildings.Fluid.Geothermal.Borefields.TOUGH
Information
Package with base classes for geothermal borefields with the ground response calculated by the simulator TOUGH.
Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).
Package Content
| Name | Description |
|---|---|
| Ground response calculated by the TOUGH simulator | |
| Borefield model using single U-tube borehole heat exchanger configuration.Calculates the average fluid temperature T_fts of the borefield for a given (time dependent) load Q_flow | |
| Block that exchanges a vector of real values with a Python function | |
| Package with borehole heat exchangers | |
Buildings.Fluid.Geothermal.Borefields.TOUGH.BaseClasses.GroundResponse
Ground response calculated by the TOUGH simulator
Information
This model calculates the ground temperature response to obtain the temperature at the borehole wall in a geothermal system where heat is being injected into or extracted from the ground.
The instance pyt finds the ground response with the
TOUGH simulator
through the Python interface
Buildings.Utilities.IO.Python_3_12.Real_Real. See
Buildings.Fluid.Geothermal.Borefields.TOUGH.UsersGuide
for instructions.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Height | hBor | Total height of the borehole [m] | |
| Integer | nSeg | Total number of segments | |
| Integer | nInt | Number of points in the ground to be investigated | |
| Integer | nTouSeg | Total number of grids along the entire borehole in the TOUGH mesh | |
| String | touWorDir | TOUGH working directory name | |
| Sampling | |||
| Time | samplePeriod | Sample period of component [s] | |
Connectors
| Type | Name | Description |
|---|---|---|
| input RealInput | QBor_flow[nSeg] | Heat flow from boreholes (positive if heat from fluid into soil) [W] |
| input RealInput | TBorWal_start[nSeg] | Initial borehole outer wall temperature at the beginning of the simulation [K] |
| input RealInput | TOut | Outdoor air temperature [K] |
| output RealOutput | TBorWal[nSeg] | Temperature of current borehole wall temperature [K] |
| output RealOutput | pInt[nInt] | Pressure of the interested points in the ground |
| output RealOutput | xInt[nInt] | Saturation of the interested points in the ground |
| output RealOutput | TInt[nInt] | Temperature at the interested points in the ground [K] |
Modelica definition
Buildings.Fluid.Geothermal.Borefields.TOUGH.BaseClasses.PartialBorefield
Borefield model using single U-tube borehole heat exchanger configuration.Calculates the average fluid temperature T_fts of the borefield for a given (time dependent) load Q_flow
Information
This model simulates a borefield containing one or multiple boreholes
using the parameters in the borFieDat record.
Heat transfer to the soil is modeled using only one borehole heat exchanger (To be added in an extended model). The fluid mass flow rate into the borehole is divided to reflect the per-borehole fluid mass flow rate. The borehole model calculates the dynamics within the borehole itself using an axial discretization and a resistance-capacitance network for the internal thermal resistances between the individual pipes and between each pipe and the borehole wall.
The thermal interaction between the borehole wall and the surrounding soil is modeled using Buildings.Fluid.Geothermal.Borefields.TOUGH.BaseClasses.GroundResponse.
Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model with two ports and declaration of quantities that are used by many models), Buildings.Fluid.Interfaces.TwoPortFlowResistanceParameters (Parameters for flow resistance for models with two ports).
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| replaceable package Medium | PartialMedium | Medium in the component | |
| Template | borFieDat | Borefield data | |
| PartialBorehole | borHol | redeclare Buildings.Fluid.Ge... | Borehole |
| Nominal condition | |||
| MassFlowRate | m_flow_nominal | borFieDat.conDat.mBorFie_flo... | Nominal mass flow rate [kg/s] |
| PressureDifference | dp_nominal | borFieDat.conDat.dp_nominal | Pressure difference [Pa] |
| Ground response | |||
| Integer | nTouSeg | Total number of grids along the entire borehole in the TOUGH mesh | |
| Integer | nSeg | Number of segments to use in vertical discretization of the boreholes | |
| Integer | nInt | Number of points in the ground to be investigated | |
| Time | samplePeriod | Sample period of component [s] | |
| String | touWorDir | TOUGH working directory name | |
| Assumptions | |||
| Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
| Advanced | |||
| MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
| Diagnostics | |||
| Boolean | show_T | false | = true, if actual temperature at port is computed |
| Flow resistance | |||
| Boolean | computeFlowResistance | (borFieDat.conDat.dp_nominal... | =true, compute flow resistance. Set to false to assume no friction |
| Boolean | from_dp | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
| Real | n | 2 | Flow exponent, n=1 for laminar, n=2 for turbulent |
| Boolean | linearizeFlowResistance | false | = true, use linear relation between m_flow and dp for any flow rate |
| Real | deltaM | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
| Dynamics | |||
| Equations | |||
| Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
| Initialization | |||
| AbsolutePressure | p_start | Medium.p_default | Start value of pressure [Pa] |
| Temperature | TFlu_start[nSeg] | TGro_start | Start value of fluid temperature [K] |
| Soil | |||
| Temperature | TExt0_start | 283.15 | Initial far field temperature [K] |
| Temperature | TExt_start[nSeg] | {if z[i] >= z0 then TExt0_st... | Temperature of the undisturbed ground [K] |
| Filling material | |||
| Temperature | TGro_start[nSeg] | TExt_start | Start value of grout temperature [K] |
| Temperature profile | |||
| Height | z0 | 10 | Depth below which the temperature gradient starts [m] |
| Real | dT_dz | 0.01 | Vertical temperature gradient of the undisturbed soil for h below z0 [K/m] |
Connectors
| Type | Name | Description |
|---|---|---|
| FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
| FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
| replaceable package Medium | Medium in the component | |
| output RealOutput | TBorAve | Average borehole wall temperature in the borefield [K] |
| input RealInput | TOut | Outdoor air temperature [K] |
Modelica definition
Buildings.Fluid.Geothermal.Borefields.TOUGH.BaseClasses.Real_Real
Block that exchanges a vector of real values with a Python function
Information
Block that exchanges data with a Python function that does not need to pass an object from one call to the next.
For each element in the input vector uR[nDblWri],
the value of the flag flaDblWri[nDblWri] determines whether
the current value, the average over the sampling interval or the integral
over the sampling interval is sent to Python. The following three options are allowed:
| flaDblWri[i] | Value sent to Python |
| 0 | Current value of uR[i] |
| 1 | Average value of uR[i] over the sampling interval |
| 2 | Integral of uR[i] over the sampling interval |
If the function needs to pass an object from one invocation to the
next, set passPythonObject = true.
Otherwise, leave it at its default value passPythonObject = false.
Note that the model is same as Buildings.Utilities.IO.Python_3_12.Real_Real, except the model propagates the parameters for strings writing to Python.
Extends from Modelica.Blocks.Interfaces.DiscreteBlock (Base class of discrete control blocks).
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Time | samplePeriod | Sample period of component [s] | |
| Time | startTime | 0 | First sample time instant [s] |
| String | moduleName | Name of the python module that contains the function | |
| String | functionName | moduleName | Name of the python function |
| Integer | nDblWri | Number of double values to write to Python | |
| Integer | nDblRea | Number of double values to be read from the Python | |
| String | strWri[max(1, nStrWri)] | {""} | String values to write |
| Integer | flag | 0 | Flag for double values (0: use current value, 1: use average over interval, 2: use integral over interval) |
| Boolean | passPythonObject | false | Set to true if the Python function returns and receives an object, see User's Guide |
Connectors
| Type | Name | Description |
|---|---|---|
| input RealInput | uR[nDblWri] | Real inputs to be sent to Python |
| output RealOutput | yR[nDblRea] | Real outputs received from Python |