bc_defs

Generic Boundary Conditions

class bc_defs.BoundaryCondition(type_of_BC=<object object at 0x2aebd994af90>, Twall=300.0, Pout=100000.0, Tout=300.0, use_Tout=False, inflow_condition=None, x_order=0, sponge_flag=0, other_block=-1, other_face=-1, orientation=0, filename='', n_profile=1, is_wall=0, sets_conv_flux=0, sets_visc_flux=0, assume_ideal=0, mdot=[], Twall_i=300.0, Twall_f=300.0, t_i=0.0, t_f=0.0, emissivity=1.0, sigma_jump=1.0, r_omega=None, centre=None, v_trans=None, Twall_flag=False, reorient_vector_quantities=False, Rmatrix=[1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0], mass_flux=0.0, p_init=100000.0, relax_factor=0.05, p0_min=25000.0, p0_max=200000.0, direction_type='normal', direction_vector=[1.0, 0.0, 0.0], direction_alpha=0.0, direction_beta=0.0, ghost_cell_trans_fn=<function <lambda> at 0x2aebd9f751b8>, I_turb=0.0, u_turb_lam=1.0, T_non=[300.0, 300.0, 300.0], starting_blk=0, no_blk=[1.0, 1.0, 1.0], label='')

Base class for boundary condition specifications.

BoundaryCondition.__init__(type_of_BC=<object object at 0x2aebd994af90>, Twall=300.0, Pout=100000.0, Tout=300.0, use_Tout=False, inflow_condition=None, x_order=0, sponge_flag=0, other_block=-1, other_face=-1, orientation=0, filename='', n_profile=1, is_wall=0, sets_conv_flux=0, sets_visc_flux=0, assume_ideal=0, mdot=[], Twall_i=300.0, Twall_f=300.0, t_i=0.0, t_f=0.0, emissivity=1.0, sigma_jump=1.0, r_omega=None, centre=None, v_trans=None, Twall_flag=False, reorient_vector_quantities=False, Rmatrix=[1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0], mass_flux=0.0, p_init=100000.0, relax_factor=0.05, p0_min=25000.0, p0_max=200000.0, direction_type='normal', direction_vector=[1.0, 0.0, 0.0], direction_alpha=0.0, direction_beta=0.0, ghost_cell_trans_fn=<function <lambda> at 0x2aebd9f751b8>, I_turb=0.0, u_turb_lam=1.0, T_non=[300.0, 300.0, 300.0], starting_blk=0, no_blk=[1.0, 1.0, 1.0], label='')

Construct a generic boundary condition object.

This constructor is usually invoked by one of the more specific boundary-condition constructors. It is a catch-all for the bits of data that might be required by any particular boundary condition.

Parameters:
  • type_of_BC – specifies the boundary condition (symbol value)
  • Twall – fixed wall temperature (in degrees K) that will be used if the boundary conditions needs such a value.
  • Pout – fixed outside pressure (in Pascals) that will be used if the boundary conditions needs such a value.
  • Tout – may also have a fixed outside temperature (degrees K) to go with Pout, to make an ambient condition
  • use_Tout – for the FixedPOutBC, decide whether to use Tout as well.
  • inflow_condition – the flow condition that will be applied if the specified boundary condition needs it.
  • x_order – Extrapolation order of the boundary conduition. 0=just copy the nearest cell data into both ghost cells (zero-order extrapolation). 1=linear extrapolation of the interior data into the ghost cells.
  • sponge_flag – A value of 1 will activate Andrew Denman’s damping terms near the boundary.
  • other_block – index to an adjacent block, if any. A value of -1 will indicate that there is no adjacent block.
  • other_face – index of the adjacent face of the other block, if any.
  • orientation – for 3D connections the other block face can have one of 4 rotational orientations.
  • filename – Name of the UDF source file (in Lua) or of the profile data, if relevant.
  • n_profile – Number of profiles to be found in the input data file for the StaticProfileBC.
  • is_wall – Flag to indicate that various parts of the simulation code should treat this boundary as a solid wall.
  • sets_conv_flux – For this boundary, the fluxes are computed directly. Typically, this relates to using a user-supplied Lus script which provides a convective_flux() function. This pretty much ignores the ghost-cell data, however, it does not relieve the user of supplying a suitable function for setting that data.
  • sets_visc_flux – As for sets_conv_flux except that this relates to setting the viscous component of flux due to the effect of the boundary.
  • assume_ideal
  • mdot – species ablation rate (list)
  • emissivity – surface radiative emissivity (between 0 and 1)
  • sigma_jump – accommodation coefficient for velocity/temperature jump boundary
  • Twall_i – initial temperature for sliding temperature BC
  • Twall_f – final temperature for sliding temperature BC
  • t_i – initial time for sliding temperature BC
  • t_f – final time for sliding temperature BC
  • r_omega – angular velocity for Jason Qin’s moving-wall boundary
  • centre – a point on the axis of rotation for the moving-wall boundary
  • v_tran – a translational velocity to superimpost on the moving-wall boundary
  • Twall_flag – a boolean parameter to select fixed Twall for moving-wall boundary
  • reorient_vector_quantities – for exchange of vector quantities between adjacent boundaries
  • Rmatrix – the 9 elements of the rotation matrix
  • mass_flux – mass flux per unit area (in kg/s/m**2) across the block boundary
  • p_init – initial pressure (in Pa) at the mass-flux-out boundary
  • relax_factor – relaxation factor for adjustment of the actual pressure applied to the ghost-cells of the mass-flux-out boundary or the subsonic-in boundary
  • p0_min – minimum stagnation pressure for the mass-flux controlled subsonic-in boundary
  • p0_max – maximum stagnation pressure for the mass-flux controlled subsonic-in boundary
  • direction_type – “normal” (default) is to have the inflow velocity locally-normal to the subsonic-in boundary. “uniform” has the inflow velocity aligned with direction_vector “radial” radial-inflow (turbine) through a cylindrical surface with flow angles direction_alpha and direction_beta. “axial” axial-flow (turbine) through a circular surface with flow angles direction_alpha and direction_beta.
  • direction_vector – List of x,y,z-components specifying the direction that the inflow velocity follows if direction_type==”uniform”
  • direction_alpha – flow angle splitting the in-plane velocity into radial and tangential components for direction_type==”radial” or “axial” (radians)
  • direction_beta – flow angle determining axial-velocity component for direction_type==”radial” or “axial” (radians)
  • ghost_cell_trans_fn – User-supplied transform function mapping from ghost-cell position to source-cell position.
  • label – A string that may be used to assist in identifying the boundary in the post-processing phase of a simulation.

Inflow Boundary Conditions

class bc_defs.SupInBC(inflow_condition, label='')

Apply a (presumably) supersonic inflow condition to the boundary.

The inflow_condition data is copied into the ghost cells.

SupInBC.__init__(inflow_condition, label='')

Construct a supersonic-inflow boundary condition.

Parameters:
  • inflow_condition – A reference to a previously-constructed FlowCondition object.
  • label – A string that may be used to assist in identifying the boundary in the post-processing phase of a simulation.
class bc_defs.SubsonicInBC(inflow_condition, mass_flux=0.0, relax_factor=0.05, p0_min=None, p0_max=None, direction_type='normal', direction_vector=[1.0, 0.0, 0.0], direction_alpha=0.0, direction_beta=0.0, assume_ideal=False, label='')

Apply a possibly subsonic inflow condition to the boundary.

assume_ideal==0: use generalized stepping, down from stagnation to get conditions.

SubsonicInBC.__init__(inflow_condition, mass_flux=0.0, relax_factor=0.05, p0_min=None, p0_max=None, direction_type='normal', direction_vector=[1.0, 0.0, 0.0], direction_alpha=0.0, direction_beta=0.0, assume_ideal=False, label='')

Construct a subsonic-inflow boundary.

Parameters:
  • inflow_condition – Refers to a FlowCondition object that represents the total conditions for flow at the boundary.
  • mass_flux – required inflow mass-flux per unit area (in kg/s/m**2) Set to 0.0 (default) if you don’t wish to specify a value.
  • relax_factor – under-relaxation is advised.
  • p0_min – minimum allowed total pressure (in Pa) If a value is not supplied, a value of 0.25 times the inflow_condition pressure is computed.
  • p0_max – maximim allowed total pressure (in Pa) If a value is not supplied, a value of 2.0 times the inflow_condition pressure is computed.
  • direction_type – “normal” (default) is to have the inflow velocity locally-normal to the boundary. “uniform” has the inflow velocity aligned with direction_vector “radial” radial-inflow (turbine) through a cylindrical surface with flow angles direction_alpha and direction_beta. “axial” axial-flow (turbine) through a circular surface with flow angles direction_alpha and direction_beta.
  • direction_vector – List of x,y,z-components specifying the direction that the inflow velocity follows if direction_type==”uniform”
  • direction_alpha – flow angle splitting the in-plane velocity into radial and tangential components for direction_type==”radial” or “axial” (radians)
  • direction_beta – flow angle determining axial-velocity component for direction_type==”radial” or “axial” (radians)
  • assume_ideal – (not working) A value of True allows the code to use ideal gas relations to get an estimate of the ghost-cell conditions. A value of False, causes the code to compute the ghost-cell flow conditions from the total-conditions by making a number of finite steps through the isentropic expansion while allowing a general equation of state.
  • label – A string that may be used to assist in identifying the boundary in the post-processing phase of a simulation.

The flow is assumed to enter the domain in a direction the is locally-normal to the boundary.

class bc_defs.TransientUniBC(filename='transient_uniform.dat', label='')

Transient but uniform inflow is applied to the ghost cells at the boundary.

The actual flow data is read (at run time) from the file transient_uni.dat. Mostly, this boundary condition is used to get L1d3 simulation data to drive an axisymmetric simulation here.

TransientUniBC.__init__(filename='transient_uniform.dat', label='')

Construct a uniform-inflow boundary with user-specified, transient properties.

Parameters:
  • filename – containing the specified flow conditions that will be applied uniformly along the boundary.
  • label – A string that may be used to assist in identifying the boundary in the post-processing phase of a simulation.
class bc_defs.StaticProfBC(filename='profile.dat', n_profile=1, label='')

Static, non-uniform inflow is applied to the ghost cells at the boundary.

The actual flow data is read (at run time) from the specified file.

StaticProfBC.__init__(filename='profile.dat', n_profile=1, label='')

Construct an inflow boundary with user-specified properties.

Parameters:
  • filename – containing the specified flow conditions that may vary along the boundary.
  • label – A string that may be used to assist in identifying the boundary in the post-processing phase of a simulation.

Outflow Boundary Conditions

class bc_defs.ExtrapolateOutBC(x_order=0, sponge_flag=0, label='')

Fill the ghost cells with data from just inside the boundary.

This boundary condition will work best if the flow is supersonic, directed out of the flow domain.

ExtrapolateOutBC.__init__(x_order=0, sponge_flag=0, label='')

Construct an outflow BC that extrapolates the interior flow data.

Parameters:
  • x_order – Extrapolation order of the boundary conduition. 0=just copy the nearest cell data into both ghost cells (zero-order extrapolation). 1=linear extrapolation of the interior data into the ghost cells.
  • sponge_flag – A value of 1 will activate Andrew Denman’s damping terms near the boundary.
  • label – A string that may be used to assist in identifying the boundary in the post-processing phase of a simulation.
class bc_defs.FixedPOutBC(Pout, Tout=300.0, use_Tout=False, x_order=0, label='')

Something like ExtrapolateOutBC but with the pressure set to some user-specified value.

It is probably best to set this pressure at the same value as the initial fill pressure so that this boundary condition will be passive until a wave arrives at the boundary.

FixedPOutBC.__init__(Pout, Tout=300.0, use_Tout=False, x_order=0, label='')

Construct an outflow BC that extrapolates the interior flow data but specifies pressure directly.

Parameters:
  • Pout – fixed outside pressure (in Pascals)
  • Tout – (optional) fixed outside temperature (in Kelvin)
  • use_Tout – boolean flag to indicate whether to use Tout
  • x_order – Extrapolation order of the boundary condition. 0=just copy the nearest cell data into both ghost cells (zero-order extrapolation). 1=linear extrapolation of the interior data into the ghost cells.
  • label – A string that may be used to assist in identifying the boundary in the post-processing phase of a simulation.

Wall Boundary Conditions

class bc_defs.SlipWallBC(emissivity=1.0, label='')

An inviscid-flow solid-boundary.

Effectively, this boundary condition copies and reflects the properties just inside the boundary into the ghost cells. This is the default boundary condition applied to a block face if you don’t otherwise specify a boundary condition.

SlipWallBC.__init__(emissivity=1.0, label='')

Construct a no-friction, solid-wall boundary.

Parameters:label – A string that may be used to assist in identifying the boundary in the post-processing phase of a simulation.
class bc_defs.AdiabaticBC(label='')

A solid, no-slip wall without heat transfer.

The near-wall temperature is reflected in the ghost cells. This BC is only effective if viscous effects are active else it acts as another solid (slip) wall.

AdiabaticBC.__init__(label='')

Construct a no-slip, no-heat-transfer, solid-wall boundary.

Parameters:label – A string that may be used to assist in identifying the boundary in the post-processing phase of a simulation.
class bc_defs.FixedTBC(Twall, emissivity=1.0, label='')

A solid boundary with no-slip and a user specified temperature.

Like the AdiabaticBC, this is completey effective only when viscous effects are active. Else, it is just like another solid (slip) wall.

FixedTBC.__init__(Twall, emissivity=1.0, label='')

Construct a no-slip, fixed-temperature, solid-wall boundary.

Parameters:
  • Twall – fixed wall temperature (in degrees K)
  • emissivity – surface radiative emissivity (between 0 and 1)
  • label – A string that may be used to assist in identifying the boundary in the post-processing phase of a simulation.
class bc_defs.fstcBC(filename='fstc_temperatures.dat', label='')

A solid boundary with no-slip and a user-specified temperature.

Like the AdiabaticBC, this is completey effective only when viscous effects are active. Else, it is just like another solid (slip) wall.

fstcBC.__init__(filename='fstc_temperatures.dat', label='')

Construct a no-slip, fixed-temperature, solid-wall boundary.

Parameters:
  • filename – containing the specified temperatures for each cell along the boundary.
  • label – A string that may be used to assist in identifying the boundary in the post-processing phase of a simulation.
class bc_defs.SlidingTBC(Twall_i, Twall_f, t_i, t_f, label='')

A solid boundary with no-slip and a user specified sliding temperature range.

Like the AdiabaticBC, this is completey effective only when viscous effects are active. Else, it is just like another solid (slip) wall.

SlidingTBC.__init__(Twall_i, Twall_f, t_i, t_f, label='')

Construct a no-slip, sliding-temperature, solid-wall boundary.

Parameters:
  • Twall_i
  • Twall_f
  • t_i
  • t_f
  • label – A string that may be used to assist in identifying the boundary in the post-processing phase of a simulation.

User-Defined Boundary Conditions

class bc_defs.UserDefinedBC(filename='udf.lua', is_wall=0, sets_conv_flux=0, sets_visc_flux=0, label='')

The user defines the flow properties to use the ghost cells via a Lua function.

The actual flow data is computed (at run time) from the functions defined in that file. For details, please see the Appendix in the User Guide and Example Book.

UserDefinedBC.__init__(filename='udf.lua', is_wall=0, sets_conv_flux=0, sets_visc_flux=0, label='')

Construct a user-defined boundary condition.

Parameters:
  • filename – Name of the file containing the Lua functions.
  • is_wall – Flag to indicate that various parts of the simulation code should treat this boundary as a solid wall.
  • sets_conv_flux – For this boundary, the fluxes are computed directly. Typically, this relates to using a user-supplied Lus script which provides a convective_flux() function. This pretty much ignores the ghost-cell data, however, it does not relieve the user of supplying a suitable function for setting that data.
  • sets_visc_flux – As for sets_conv_flux except that this relates to setting the viscous component of flux due to the effect of the boundary.
  • label – A string that may be used to assist in identifying the boundary in the post-processing phase of a simulation.

Inter-Block Boundary Conditions

class bc_defs.AdjacentBC(other_block=-1, other_face=-1, orientation=0, reorient_vector_quantities=False, Rmatrix=[1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0], label='')

This boundary joins (i.e. is adjacent to) a boundary of another block.

AdjacentBC.__init__(other_block=-1, other_face=-1, orientation=0, reorient_vector_quantities=False, Rmatrix=[1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0], label='')

Join the boundary face to a boundary-face of another block.

This condition is usually not set manually but is set as part of the connect_blocks() function. There should be a corresponding AdjacentBC on the other block and the connect_blocks() function ensures this.

Parameters:
  • other_block – index to an adjacent block, if any. A value of -1 will indicate that there is no adjacent block.
  • other_face – index of the adjacent face of the other block, if any.
  • orientation – for 3D connections the other block face can have one of 4 rotational orientations.
  • reorient_vector_quantities – for exchange of vector quantities between adjacent boundaries
  • Rmatrix – the 9 elements of the rotation matrix
  • label – A string that may be used to assist in identifying the boundary in the post-processing phase of a simulation.
class bc_defs.AdjacentPlusUDFBC(other_block=-1, other_face=-1, orientation=0, filename='udf.lua', is_wall=0, sets_conv_flux=0, sets_visc_flux=0, reorient_vector_quantities=False, Rmatrix=[1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0], label='')

This boundary joins (i.e. is adjacent to) a boundary of another block and a user-defined (Lua) function is used.

Usually, this condition is not set manually but is set as part of the connect_blocks() function.

AdjacentPlusUDFBC.__init__(other_block=-1, other_face=-1, orientation=0, filename='udf.lua', is_wall=0, sets_conv_flux=0, sets_visc_flux=0, reorient_vector_quantities=False, Rmatrix=[1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0], label='')

Construct a connecting boundary condition that also has some user-defined behaviour.

Parameters:
  • other_block – index to an adjacent block, if any. A value of -1 will indicate that there is no adjacent block.
  • other_face – index of the adjacent face of the other block, if any.
  • orientation – for 3D connections the other block face can have one of 4 rotational orientations.
  • filename – Name of the file containing the Lua functions.
  • is_wall – Flag to indicate that various parts of the simulation code should treat this boundary as a solid wall.
  • sets_conv_flux – For this boundary, the fluxes are computed directly. Typically, this relates to using a user-supplied Lus script which provides a convective_flux() function. This pretty much ignores the ghost-cell data, however, it does not relieve the user of supplying a suitable function for setting that data.
  • sets_visc_flux – As for sets_conv_flux except that this relates to setting the viscous component of flux due to the effect of the boundary.
  • reorient_vector_quantities – for exchange of vector quantities between adjacent boundaries
  • Rmatrix – the 9 elements of the rotation matrix
  • label – A string that may be used to assist in identifying the boundary in the post-processing phase of a simulation.