PyHelios 0.1.11
Loading...
Searching...
No Matches
Boundary-Layer Conductance Model Plugin Documentation

DependenciesNone
Python Importfrom pyhelios import BoundaryLayerConductanceModel
Main ClassBoundaryLayerConductanceModel

System Requirements

Dependencies None
Platforms Windows, Linux, macOS
GPU Not required

Quick Start

from pyhelios import Context, BoundaryLayerConductanceModel
from pyhelios.types import vec3, vec2
with Context() as context:
# Create leaf geometry
leaf_uuid = context.addPatch(center=vec3(0, 0, 1), size=vec2(0.1, 0.1))
# Set environmental conditions (optional - defaults used if not set)
context.setPrimitiveData(leaf_uuid, "wind_speed", 2.0) # m/s
context.setPrimitiveData(leaf_uuid, "air_temperature", 298.0) # K
# Use boundary-layer conductance model
with BoundaryLayerConductanceModel(context) as blc:
# Set model for all primitives (default is Pohlhausen)
blc.setBoundaryLayerModel("InclinedPlate")
# Run calculation
blc.run()
# Get results
gH = context.getPrimitiveData(leaf_uuid, "boundarylayer_conductance")
print(f"Boundary-layer conductance: {gH[0]:.3f} mol air/m²-s")

Known Issues

None.

Introduction

The boundary-layer conductance to heat describes the rate of energy transfer across the primitive boundary-layer for a given driving temperature difference. Currently, four different boundary-layer conductance models are available as part of this plug-in.

BLConductanceModel Class Constructor

Constructors
BoundaryLayerConductanceModel

The BoundaryLayerConductanceModel class is initialized by passing the Helios context as an argument to the constructor.

Input/Output Primitive Data

Input Primitive Data

Primitive DataUnitsData TypeDescriptionAvailable Plug-insDefault Value
wind_speedm/s floatAir wind speed just outside of primitive boundary-layer.N/A1 m/s
object_lengthm floatCharacteristic dimension of object formed by primitive.N/ASquare root of primitive surface area
air_temperatureKelvin floatAmbient air temperature outside of surface boundary layer.N/A290 K
surface_temperatureKelvin floatObject surface temperature.EnergyBalanceModel300 K
twosided_flagN/A uintNumber of primitive faces with energy transfer (must be 1 or 2).N/A2

Default Output Primitive Data

Primitive DataUnitsData TypeDescription
boundarylayer_conductancemol air/m2-s floatPrimitive boundary-layer conductance calculated by this plug-in.

Using the Boundary Layer Conductance Model Plug-in

Input Variables

Inputs to the model are set by creating primitive variable data in the usual way. If a variable needed for a model input has not been create in the Context, the default value is assumed.

Boundary-layer Conductance Models

There are four different built-in models for the boundary-layer conductance. The boundary-layer conductance model is set using the setBoundaryLayerModel() function, which takes as arguments the UUID(s) of primitives for which the model is to be set, and a string referencing the chosen model. Possible models are summarized in the table below and described in further detail below. If the setBoundaryLayerModel() is called for some UUIDs but not others, the plug-in will assume the default model (Pohlhausen) for any primitives for which no model was explicitly set.

It is also important to note that, by default, the length scale used to calculate the boundary-layer conductance is taken to be the square root of the primitive surface area. If the size of the object is different from the size of the primitive, then it is important to manually set the length scale to be the size of the object, as this is the relevant scale for boundary-layer development. This is usually necesary when using the boundary-layer conductance model for a sphere, for example.

The four available models are described in detail below:

Modelstring argument
1. Pohlhausen Equation (default)"Pohlhausen"
2. Inclined Plate"InclinedPlate"
3. Laminar Sphere"Sphere"
4. Ground Surface"Ground"

1. The Pohlhausen Equation (Laminar Flat Plate, Forced Convection)

The Pohlhausen equation is a classical similarity solution describing the boundary-layer conductance to heat for a flat plate parallel with the flow direction that is infinitely wide in the spanwise direction, and has finite length of \(L\) in the streamwise direction. This model also assumes that the plate/primitive boundary-layer is laminar, and that convection is entirely forced (i.e., momentum forces dominate buoyancy forces). The boundary-layer conductance is calculated as

\(g_H = 0.135 n_s\sqrt{\frac{U}{L}}\),

where \(U\) is the wind speed just outside of the primitive boundary-layer, and \(L\) is the characteristic length/dimension in the streamwise direction of the object that the primitive belongs to. For a leaf consisting of a single primitive, \(L\) could be assumed to be the length of the primitive. If the primitive belongs to a Tile Compound Object, the plug-in will automatically use the dimension of the entire tile object and not that of a single patch/tile. Note that \(g_H\) describes transfer from both sides of the plate/primitive, but transfer from each side of the plate/primitive is asymmetric because of buoyancy forces. \(n_s\) is the number of primitive faces, which is determined by the value of primitive data "twosided_flag" (twosided_flag=0 is single-sided and \(n_s=1\), twosided_flag=1 is two-sided and \(n_s=2\)).

2. Laminar Inclined Plate, Mixed Free-Forced Convection

Chen et al. (1986) provide a correlation for the boundary-layer conductance of a flat plate that is inclined with respect to the mean ambient flow direction. The correlation assumes that the plate is infinite in the spanwise direction, and has length \(L\) in the other direction.

The boundary-layer conductance for a plate inclined at \(\theta_L\leq 75^\circ\) is given by

\(g_H(\theta_L)=\frac{\rho_a \nu}{Pr\,D_L}2F_1Re^{1/2}\left\{1\pm\left[\frac{2F_2\left(Gr\,\mathrm{cos}\,\theta_L/Re^2\right)^{1/4}}{3F_1}\right]^3\right\}^{1/3},\)

and for \(\theta_L>75^\circ\) as

\(g_H(\theta_L)=\frac{\rho_a \nu}{Pr\,D_L}2F_1Re^{1/2}\left\{1\pm\left[\frac{F_3\left(Gr/Re^{5/2}\right)^{1/5}Gr^{C(\theta_L)}}{6\left[0.2+C(\theta_L)\right]F_1}\right]^3\right\}^{1/3},\)

where \(\rho_a\), \(\nu\), and \(Pr\) are respectively the molar density, kinematic viscosity, and Prandtl number of air, \(L\) is the effective leaf dimension (Parkhurst 1968), \(Re\) is the Reynolds number based on \(L\) and the local free-stream air velocity, and \(Gr\) is the Grashof number which is defined here as

\(Gr=\frac{g\beta\left(T_L-T_a\right)D_L^3}{\nu^2},\)

where \(g\) is the acceleration due to gravity, and \(\beta\) is the volumetric thermal expansion coefficient which we approximate as the inverse of absolute ambient air temperature \(1/T_a\) with \(T_a\) in units of Kelvin. The plus and minus signs corresponds to buoyancy assisting flow and opposing flow cases, respectively. In the present model, the mean wind vector is always orthogonal to the gravity vector (transverse flow), and thus we always take the positive or buoyancy assisting flow case. The constants in the correlations are defined as

\(F_1=0.399Pr^{1/3}\left[1+\left(0.0468/Pr\right)^{2/3}\right]^{-1/4},\)

\(F_2=0.75Pr^{1/2}\left[2.5\left(1+2Pr^{1/2}+2Pr\right)\right]^{-1/4},\)

\(F_3=Pr^{1/2}\left[0.25+1.6Pr^{1/2}\right]^{-1}\left(Pr/5\right)^{0.2+C(\theta_L)},\)

\(C(\theta_L)=0.070\left(\mathrm{cos}\,\theta_L\right)^{1/2}.\)

Chen et al. (1986) mention that the equation for \(\theta_L\leq 75^\circ\) is valid for \(10^3\leq Re \leq 10^5\), and the equation for \(\theta_L>75^\circ\) is valid for \(10^3\leq GrPr \leq 10^9\). We expect leaf Reynolds numbers somewhere between \(5\times 10^3\) and \(5\times 10^4\). Average \(Gr Pr\) values are usually on the order of \(10^6\). When \(T_L \approx T_a\), it is possible for \(Gr Pr\) to drop below \(10^3\), however in these cases the net radiation is usually nearly zero and convective heat fluxes are low anyway.

3. Laminar flow around a sphere

Bird et al. (1960) provides correlation for forced convection heat transfer in laminar flow around a sphere

\(g_H = \frac{0.00164}{D} + 0.110\sqrt{\frac{U}{D}}\),

where \(D\) is the sphere diameter, and \(U\) is the wind speed outside of the sphere boundary-layer.

4. Flow over bare ground

Kustas and Norman (1999) suggest a simple relationship for the convective heat conductance over flat, bare ground:

\(g_H = 0.166+0.5U,\)

where \(U\) is the wind speed at a height above the soil surface where the effect of the soil surface roughness is minimal; typically 0.05 to 0.2 m.

Setting the Boundary-layer Conductance Model To Be Used

from pyhelios import Context, BoundaryLayerConductanceModel
# Declare the Context and add two primitives
with Context() as context:
UUID0 = context.addPatch()
UUID1 = context.addPatch()
# Initialize the boundary-layer conductance Model
with BoundaryLayerConductanceModel(context) as boundarylayerconductance:
# This changes the boundary-layer conductance model for all (both) primitives
boundarylayerconductance.setBoundaryLayerModel("InclinedPlate")
# This changes the boundary-layer conductance model for the second primitive (while the first will keep the model set above)
boundarylayerconductance.setBoundaryLayerModel("Ground", uuids=[UUID1])

Running the Model

The model can be run to calculate the boundary-layer conductance for all primitives or a sub-set of primitives using the appropriate run function below.

Functions to perform boundary-layer conductance model calculations.
Model Run FunctionDescription
run()Run model calculations for all primitives in the Context.
run(uuids)Run model calculations for a select set of primitives in the Context, which are specified by a list of their UUIDs.