0.1.8
Loading...
Searching...
No Matches
pyhelios.BoundaryLayerConductance.BoundaryLayerConductanceModel Class Reference

High-level interface for boundary layer conductance modeling and heat/mass transfer calculations. More...

Detailed Description

High-level interface for boundary layer conductance modeling and heat/mass transfer calculations.

This class provides a user-friendly wrapper around the native Helios boundary layer conductance plugin with automatic plugin availability checking and graceful error handling.

The boundary layer conductance model implements four different boundary-layer models:

  • Pohlhausen: Laminar flat plate, forced convection (default)
  • InclinedPlate: Mixed free-forced convection for inclined plates
  • Sphere: Laminar flow around a sphere
  • Ground: Flow over bare ground surface

System requirements:

  • Cross-platform support (Windows, Linux, macOS)
  • No GPU required
  • No special dependencies
  • Boundary layer conductance plugin compiled into PyHelios

Examples

>>> from pyhelios import Context, BoundaryLayerConductanceModel
>>>
>>> with Context() as context:
... # Add leaf geometry
... leaf_uuid = context.addPatch(center=[0, 0, 1], size=[0.1, 0.1])
...
... with BoundaryLayerConductanceModel(context) as bl_model:
... # Set model for all primitives (default is Pohlhausen)
... bl_model.setBoundaryLayerModel("InclinedPlate")
...
... # Run calculation
... bl_model.run()
...
... # Or set different models for different primitives
... bl_model.setBoundaryLayerModel("Sphere", uuids=[leaf_uuid])
... bl_model.run(uuids=[leaf_uuid])

Definition at line 63 of file BoundaryLayerConductance.py.

Public Member Functions

 __init__ (self, Context context)
 Initialize BoundaryLayerConductanceModel with graceful plugin handling.
 
 __enter__ (self)
 Context manager entry.
 
 __exit__ (self, exc_type, exc_value, traceback)
 Context manager exit with proper cleanup.
 
 getNativePtr (self)
 Get the native pointer for advanced operations.
 
None enableMessages (self)
 Enable console output messages from the boundary layer conductance model.
 
None disableMessages (self)
 Disable console output messages from the boundary layer conductance model.
 
None setBoundaryLayerModel (self, str model_name, Optional[List[int]] uuids=None)
 Set the boundary layer conductance model to be used.
 
None run (self, Optional[List[int]] uuids=None)
 Run the boundary layer conductance calculations.
 

Static Public Member Functions

bool is_available ()
 Check if BoundaryLayerConductanceModel plugin is available in current build.
 

Public Attributes

 context = context
 
 bl_model = None
 

Constructor & Destructor Documentation

◆ __init__()

pyhelios.BoundaryLayerConductance.BoundaryLayerConductanceModel.__init__ ( self,
Context context )

Initialize BoundaryLayerConductanceModel with graceful plugin handling.

Parameters
contextHelios Context instance
Exceptions
TypeErrorIf context is not a Context instance
BoundaryLayerConductanceModelErrorIf boundary layer conductance plugin is not available

Definition at line 75 of file BoundaryLayerConductance.py.

Member Function Documentation

◆ __enter__()

pyhelios.BoundaryLayerConductance.BoundaryLayerConductanceModel.__enter__ ( self)

Context manager entry.

Definition at line 133 of file BoundaryLayerConductance.py.

◆ __exit__()

pyhelios.BoundaryLayerConductance.BoundaryLayerConductanceModel.__exit__ ( self,
exc_type,
exc_value,
traceback )

Context manager exit with proper cleanup.

Definition at line 137 of file BoundaryLayerConductance.py.

◆ disableMessages()

None pyhelios.BoundaryLayerConductance.BoundaryLayerConductanceModel.disableMessages ( self)

Disable console output messages from the boundary layer conductance model.

Exceptions
BoundaryLayerConductanceModelErrorIf operation fails

Definition at line 169 of file BoundaryLayerConductance.py.

◆ enableMessages()

None pyhelios.BoundaryLayerConductance.BoundaryLayerConductanceModel.enableMessages ( self)

Enable console output messages from the boundary layer conductance model.

Exceptions
BoundaryLayerConductanceModelErrorIf operation fails

Definition at line 157 of file BoundaryLayerConductance.py.

◆ getNativePtr()

pyhelios.BoundaryLayerConductance.BoundaryLayerConductanceModel.getNativePtr ( self)

Get the native pointer for advanced operations.

Definition at line 148 of file BoundaryLayerConductance.py.

◆ is_available()

bool pyhelios.BoundaryLayerConductance.BoundaryLayerConductanceModel.is_available ( )
static

Check if BoundaryLayerConductanceModel plugin is available in current build.

Returns
True if plugin is available, False otherwise

Examples

>>> if BoundaryLayerConductanceModel.is_available():
... print("Boundary layer conductance modeling is available!")

Definition at line 279 of file BoundaryLayerConductance.py.

◆ run()

None pyhelios.BoundaryLayerConductance.BoundaryLayerConductanceModel.run ( self,
Optional[List[int]] uuids = None )

Run the boundary layer conductance calculations.

   Calculates boundary-layer conductance values and stores results as
   primitive data "boundarylayer_conductance" (mol air/m²/s).
Parameters
uuidsOptional list of primitive UUIDs to process. If None, processes all primitives in the Context.
Exceptions
BoundaryLayerConductanceModelErrorIf calculation fails

Examples

>>> # Calculate for all primitives
>>> bl_model.run()
>>> # Calculate for specific primitives
>>> bl_model.run(uuids=[leaf1_uuid, leaf2_uuid])

Definition at line 254 of file BoundaryLayerConductance.py.

◆ setBoundaryLayerModel()

None pyhelios.BoundaryLayerConductance.BoundaryLayerConductanceModel.setBoundaryLayerModel ( self,
str model_name,
Optional[List[int]] uuids = None )

Set the boundary layer conductance model to be used.

   Four models are available:
   - "Pohlhausen": Laminar flat plate, forced convection (default)
   - "InclinedPlate": Mixed free-forced convection for inclined plates
   - "Sphere": Laminar flow around a sphere
   - "Ground": Flow over bare ground surface
Parameters
model_nameName of the boundary layer model to use. Must be one of: "Pohlhausen", "InclinedPlate", "Sphere", "Ground"
uuidsOptional list of primitive UUIDs to apply the model to. If None, applies to all primitives in the Context.
Exceptions
ValueErrorIf model_name is not valid
BoundaryLayerConductanceModelErrorIf operation fails

Examples

>>> # Set Pohlhausen model for all primitives
>>> bl_model.setBoundaryLayerModel("Pohlhausen")
>>> # Set InclinedPlate model for specific leaves
>>> bl_model.setBoundaryLayerModel("InclinedPlate", uuids=[uuid1, uuid2])
>>> # Set Sphere model for fruit geometry
>>> bl_model.setBoundaryLayerModel("Sphere", uuids=[fruit_uuid])
>>> # Set Ground model for soil patches
>>> bl_model.setBoundaryLayerModel("Ground", uuids=[ground_uuids])

Definition at line 209 of file BoundaryLayerConductance.py.

Member Data Documentation

◆ bl_model

pyhelios.BoundaryLayerConductance.BoundaryLayerConductanceModel.bl_model = None

Definition at line 83 of file BoundaryLayerConductance.py.

◆ context

pyhelios.BoundaryLayerConductance.BoundaryLayerConductanceModel.context = context

Definition at line 82 of file BoundaryLayerConductance.py.


The documentation for this class was generated from the following file: