bird.preprocess.dynamic_mixer package

The dynamic_mixer package generates mixer momentum sources as OpenFOAM coded fvModels (see write_fvModel()). Two mixer families share the same ball deposition:

  • Dynamic (ActuatorMixer, the mixers list) – an active actuator disk driven by a power number Np and tip speed Vtip; it adds axial thrust and swirl.

  • Static (StaticMixer, the static_mixers list) – a passive obstacle with no power input: the swirl is an energy-neutral axial-to-azimuthal redirection (swirl number S) and the axial drag is a pure viscous loss (loss coefficient K). It is inactive when the inflow opposes the mixer orientation. The momentum source follows the energy-neutral swirler model of Kiesewetter (2005).

Static mixer JSON schema

Each entry of the static_mixers list accepts:

  • S – swirl number (default 0.35).

  • K – loss coefficient / velocity heads (default 0.5).

  • radius – mixer radius; a fraction of the tube in loop mode (0.5 spans the whole tube) or an absolute radius in metres in explicit mode.

  • normal_dir – mixer axis (0/1/2 for x/y/z).

  • sign – mixer orientation along that axis ("+"/"-").

  • swirl_sign – rotation orientation ("+"/"-").

  • start_time – time after which the source is active.

Placement is either explicit (x, y, z) or on a loop branch (branch_id plus frac_space, the fraction along the branch), exactly as for the dynamic mixer.

bird.preprocess.dynamic_mixer.io_fvModels module

bird.preprocess.dynamic_mixer.io_fvModels.write_end(output_folder)
bird.preprocess.dynamic_mixer.io_fvModels.write_mixer(mixer, output_folder)
bird.preprocess.dynamic_mixer.io_fvModels.write_mixer_ball(mixer, output_folder, power_mode='from_Np_Vtip', momentum_mode='axial')

Append one ball mixer block to fvModels.

Parameters:
  • mixer (ActuatorMixer) – A ready ActuatorMixer.

  • power_mode (str) – "from_P" (drive by mixer.power) or "from_Np_Vtip" (drive by mixer.Np and mixer.Vtip).

  • momentum_mode (str) – "axial" (thrust only) or "axial_and_swirl" (thrust + tangential source using mixer.sigma).

bird.preprocess.dynamic_mixer.io_fvModels.write_mixer_force_sign(mixer, output_folder)
bird.preprocess.dynamic_mixer.io_fvModels.write_preamble(output_folder)
bird.preprocess.dynamic_mixer.io_fvModels.write_preamble_ball(output_folder)

Write the FoamFile header + codedSource preamble for the ball source.

The Newton solve is inlined in each mixer block (see write_mixer_ball), so no external dynamicMix_util.H is needed.

bird.preprocess.dynamic_mixer.io_fvModels.write_static_mixer_ball(mixer, output_folder)

Append one passive ball static-mixer block to fvModels.

The swirl is imposed as an azimuthal body force proportional to the local axial dynamic pressure (Kiesewetter), balanced cell-by-cell by an energy-neutral axial reaction; a lumped axial drag adds the viscous loss. The source is inactive when the inflow opposes the mixer orientation.

Parameters:

mixer (StaticMixer) – A ready StaticMixer.

bird.preprocess.dynamic_mixer.mixer module

class bird.preprocess.dynamic_mixer.mixer.ActuatorMixer

Bases: object

Actuator-disk mixer with optional swirl, used by the ball source.

Unlike Mixer (the legacy pancake source), momentum is deposited over a ball of physical radius R and the drive is set by a power number Np and tip speed Vtip rather than a raw power. sigma is the swirl fraction; sign is the axial push direction and swirl_sign the (independent) rotation sense.

check_status(blocks=None) → None

Log the resolved mixer and set ready if all fields are present.

update_from_expl_dict(mixer_dict: dict) → None

Populate from an explicit mixer dict (absolute position and radius).

update_from_loop_dict(mixer_dict: dict, geom_dict: dict) → None

Populate from a loop mixer dict.

Parameters:
  • mixer_dict (dict) – Mixer entry with branch_id, frac_space and, optionally, radius as a fraction of the branch cross-section.

  • geom_dict (dict) – Output of from_block_rect_to_seg (segments and blocksize).

class bird.preprocess.dynamic_mixer.mixer.Mixer

Bases: object

check_status(blocks=None)
update_from_expl_dict(mixer_dict)
update_from_loop_dict(mixer_dict, geom_dict, mesh_dict=None)
class bird.preprocess.dynamic_mixer.mixer.StaticMixer

Bases: object

Passive (unpowered) momentum-source mixer used by the ball source.

Unlike ActuatorMixer, no power is injected: the swirl is imposed as an energy-neutral axial-to-azimuthal redirection and the axial drag is a pure loss. The drive is a swirl number S and a loss coefficient K rather than Np/Vtip; sign is the mixer orientation (the source is inactive when the inflow opposes it) and swirl_sign the rotation sense.

check_status(blocks=None) → None

Log the resolved mixer and set ready if all fields are present.

update_from_expl_dict(mixer_dict: dict) → None

Populate from an explicit mixer dict (absolute position and radius).

update_from_loop_dict(mixer_dict: dict, geom_dict: dict) → None

Populate from a loop mixer dict.

Parameters:
  • mixer_dict (dict) – Mixer entry with branch_id, frac_space and, optionally, radius as a fraction of the branch cross-section (0.5 spans the whole tube).

  • geom_dict (dict) – Output of from_block_rect_to_seg (segments and blocksize).

bird.preprocess.dynamic_mixer.mixer.actuator_disk_power(Np: float, Vtip: float, R: float, rho: float = 1000.0) → float

Power [W] drawn by a from_Np_Vtip actuator-disk mixer.

P = Np * rho * Vtip**3 * D**2 / pi**3 with D = 2R (see the ball mixer derivation). Used at case-generation time to record the derived power for the efficiency QoI.

bird.preprocess.dynamic_mixer.mixing_fvModels module

bird.preprocess.dynamic_mixer.mixing_fvModels.check_input(input_dict)
bird.preprocess.dynamic_mixer.mixing_fvModels.check_static_input(input_dict)

Return the expl/loop type of each entry in the static_mixers list.

bird.preprocess.dynamic_mixer.mixing_fvModels.write_fvModel(input_dict, output_folder='.', force_sign=False)
bird.preprocess.dynamic_mixer.mixing_fvModels.write_fvModel_ball(input_dict, output_folder='.')

Write the ball (actuator-disk) fvModels.

Reads the top-level power (from_P / from_Np_Vtip) and momentum_source (axial / axial_and_swirl) modes; both default to the new full model. Each dynamic mixer is an ActuatorMixer; each entry of the optional static_mixers list is a StaticMixer appended to the same codedSource.