carbonfly.boundary module
Data models for OpenFOAM boundary condition definitions.
This module defines lightweight Python data structures used to describe physical boundary conditions (e.g. inlet, outlet, wall) in a solver-agnostic way.
The boundary objects are later consumed by writer modules to generate OpenFOAM-compatible field dictionaries.
- class carbonfly.boundary.Boundary(region_name: str, patch_name: str | None = None, btype: ~typing.Literal['inletVelocity', 'outletPressure', 'wall', 'symmetry', 'custom'] = 'inletVelocity', fields: ~typing.Dict[str, ~typing.Any] = <factory>)[source]
Bases:
objectPatch-level boundary-condition container
- boundary_field_block() Dict[str, Dict][source]
Generate the dictionary snippet for this boundary to be written into the 0/ field files. Each entry in fields should be an instance of FieldFV, FieldZG, FieldInletOutlet, etc.
- btype: Literal['inletVelocity', 'outletPressure', 'wall', 'symmetry', 'custom'] = 'inletVelocity'
- fields: Dict[str, Any]
- patch_name: str | None = None
- region_name: str
- class carbonfly.boundary.FieldAlphatJayatillekeWF(value: Any, Prt: float = 0.85)[source]
Bases:
objectcompressible::alphatJayatillekeWallFunction
- Prt: float = 0.85
- value: Any
- class carbonfly.boundary.FieldCO2FromPatchAverage(source_patch: str, name: str = 'co2FromPatchAvg')[source]
Bases:
objectSet CO2 at this patch to the area-weighted average CO2 on another patch. Typical use: AC outlet recirculation -> sample from AC inlet.
- Parameters:
source_patch (str) – Patch to sample CO2 from.
name (str) – Name of the codedFixedValue block.
- name: str = 'co2FromPatchAvg'
- source_patch: str
- class carbonfly.boundary.FieldDynamicRespiration(freq: float = 12.0, minute_vent_L_min: float = 7.2, name: str = 'breathingSine')[source]
Bases:
objectDynamic respiration velocity boundary using codedFixedValue.
- Parameters:
freq (float) – Breathing frequency in breaths per minute.
minute_vent_L_min (float) – Minute ventilation in L/min.
name (str) – Name of the codedFixedValue block.
- freq: float = 12.0
- minute_vent_L_min: float = 7.2
- name: str = 'breathingSine'
- class carbonfly.boundary.FieldEpsilonWallFunction(value: Any)[source]
Bases:
objectepsilonWallFunction
- value: Any
- class carbonfly.boundary.FieldExternalWallHeatFluxTemperature(mode: str = 'coefficient', h: Any = 0.0, Ta: Any = 300.0, value: Any = 300.0)[source]
Bases:
objectexternalWallHeatFluxTemperature
- Ta: Any = 300.0
- h: Any = 0.0
- mode: str = 'coefficient'
- value: Any = 300.0
- class carbonfly.boundary.FieldFV(value: Any)[source]
Bases:
objectFixed value boundary condition (fixedValue).
- value: Any
- class carbonfly.boundary.FieldFixedFluxPressure(value: Any | None = None)[source]
Bases:
objectfixedFluxPressure
- value: Any | None = None
- class carbonfly.boundary.FieldInletOutlet(inletValue: Any, value: Any)[source]
Bases:
objectinletOutlet boundary condition.
- inletValue: Any
- value: Any
- class carbonfly.boundary.FieldIntensityKInlet(intensity: Any = 0.14, value: Any = 0.0)[source]
Bases:
objectturbulentIntensityKineticEnergyInlet
- intensity: Any = 0.14
- value: Any = 0.0
- class carbonfly.boundary.FieldKqRWallFunction(value: Any)[source]
Bases:
objectkqRWallFunction
- value: Any
- class carbonfly.boundary.FieldMarshakRadiation(emissivityMode: str = 'lookup', emissivity: Any = 0.98, value: Any = 0.0)[source]
Bases:
objectMarshakRadiation
- emissivity: Any = 0.98
- emissivityMode: str = 'lookup'
- value: Any = 0.0
- class carbonfly.boundary.FieldMixingLengthEpsilonInlet(value: Any, mixingLength: Any = 0.0168)[source]
Bases:
objectturbulentMixingLengthDissipationRateInlet
- mixingLength: Any = 0.0168
- value: Any
- class carbonfly.boundary.FieldNoSlip[source]
Bases:
objectNo-slip boundary condition for velocity U (vector): U = 0.
- class carbonfly.boundary.FieldNutkWallFunction(value: Any)[source]
Bases:
objectnutkWallFunction
- value: Any
- class carbonfly.boundary.FieldPressureInletOutletVelocity(inletValue: Any, value: Any)[source]
Bases:
objectpressureInletOutletVelocity
- inletValue: Any
- value: Any