josie.bn package¶
Submodules¶
josie.bn.closure module¶
- class josie.bn.closure.Classical¶
Bases:
josie.bn.closure.Closure
This is the classical choice for and described in [BN86]
- pI(state_array)¶
- Parameters
Q – A array containing the values for all the state variables
- Returns
A array containing the value of the
- Return type
pI
- uI(state_array)¶
- Parameters
Q – A array containing the values for all the state variables
- Returns
A array that contains the components of the velocity .
- Return type
uI
- class josie.bn.closure.Closure¶
Bases:
object
A class representing the closure relation for and . Use them as mixin with the Equation of State in order to provide full closure for the system
- abstract pI(state_array)¶
- Parameters
Q – A array containing the values for all the state variables
- Returns
A array containing the value of the
- Return type
pI
- abstract uI(state_array)¶
- Parameters
Q – A array containing the values for all the state variables
- Returns
A array that contains the components of the velocity .
- Return type
uI
josie.bn.eos module¶
- class josie.bn.eos.TwoPhaseEOS(phase1, phase2)¶
Bases:
josie.twofluid.state.PhasePair
An Abstract Base Class representing en EOS for a twophase system. In particular two
euler.eos.EOS
instances for each phase need to be provided.You can access the EOS for a specified phase using the
__getitem__()
josie.bn.problem module¶
- class josie.bn.problem.TwoPhaseProblem(eos, closure)¶
Bases:
josie.problem.Problem
A class representing a two-phase system problem governed by the equations first described in [BN86]
- B(cells)¶
This returns the tensor that pre-multiplies the non-conservative term of the problem.
A general problem can be written in a compact way:
This method needs in general to return that for this case would be
But since most of the is zero, since we just have the terms that pre-multiply we just return that is:
- Parameters
cells (
Union
[CellSet
,MeshCellSet
]) – AMeshCellSet
that contains the cell dataeos – An implementation of the equation of state. In particular it needs to implement the
Closure
trait in order to be able to return pI and uI (in addition to theEOS
)
- F(cells)¶
This returns the tensor representing the flux for a two-fluid model as described originally by [BN86]
- Parameters
values – A
np.ndarray
that has dimension containing the values for all the values variables in all the mesh points- Returns
An array of dimension , i.e. an array that of each cell in and direction stores the flux tensor
The flux tensor is:
- Return type
F
josie.bn.schemes module¶
- class josie.bn.schemes.BaerScheme(eos, closure)¶
Bases:
josie.scheme.scheme.Scheme
A base class for a twophase scheme
- post_step(cells)¶
During the step we update the conservative values. After the step we update the non-conservative variables. This method updates the values of the non-conservative (auxiliary) variables using the
EOS
- problem: josie.bn.problem.TwoPhaseProblem¶
- class josie.bn.schemes.Rusanov(eos, closure)¶
Bases:
josie.scheme.convective.ConvectiveScheme
,josie.bn.schemes.BaerScheme
- CFL(cells, CFL_value)¶
This method returns the optimal dt value that fulfills the CFL condition for the concrete the given scheme
- Parameters
cells (
MeshCellSet
) – AMeshCellSet
containing the cell data at the current time stepCFL_value – The value of the CFL coefficient to impose
- Returns
The Optimal dt fulfilling the CFL condition for the given CFL number
- Return type
dt
- F(cells, neighs)¶
This schemes implements the Rusanov scheme for a
TwoPhaseProblem
. It applies theRusanov
scheme indipendently for each phase (with the correctly calculated among all the two phases state)- Parameters
cells (
MeshCellSet
) – AMeshCellSet
containing the state of the mesh cellsneighs (
NeighboursCellSet
) – ANeighboursCellSet
containing data of neighbour cells corresponding to thevalues
- Returns
The value of the numerical convective flux multiplied by the surface value
- Return type
F
- problem: josie.bn.problem.TwoPhaseProblem¶
- class josie.bn.schemes.Upwind(eos, closure)¶
Bases:
josie.scheme.nonconservative.NonConservativeScheme
,josie.bn.schemes.BaerScheme
An optimized upwind scheme that reduces the size of the knowing that for [BN86] the only state variable appearing in the non conservative term is . It concentratres the numerical flux computation into
G()
.Check also
B
.- G(cells, neighs)¶
This is the non-conservative flux implementation of the scheme. See [Tor09] for a great overview on numerical methods for hyperbolic problems.
A general problem can be written in a compact way:
The non-conservative term is discretized as follows:
A concrete instance of this class needs to implement the discretization of the numerical flux on one face of a cell. It needs to implement the term
- Parameters
values – The values of the state fields in each cell
neighs (
NeighboursCellSet
) – ANeighboursCellSet
containing data of neighbour cells corresponding to thevalues
- Returns
The value of the numerical nonconservative flux multiplied by the surface value
- Return type
G
- problem: josie.bn.problem.TwoPhaseProblem¶
josie.bn.solver module¶
- class josie.bn.solver.BaerSolver(mesh, scheme)¶
Bases:
josie.solver.Solver
A solver for the TwoPhase system
- t: float¶
josie.bn.state module¶
- class josie.bn.state.BaerConsState(*args, **kwargs)¶
Bases:
josie.state.SubsetState
State array for conservative part of the state
- fields¶
alias of
josie.fields.BaerConsFields
- full_state_fields¶
alias of
josie.fields.BaerFields
- class josie.bn.state.BaerPhaseState(*args, **kwargs)¶
Bases:
josie.twofluid.state.PhaseState
State array for one single phase
- fields¶
alias of
josie.fields.BaerPhaseFields
- full_state_fields¶
alias of
josie.fields.BaerFields
- class josie.bn.state.Q(*args, **kwargs)¶
Bases:
josie.twofluid.state.TwoFluidState
We create one big state that contains the actual conservative variables that are used in the flux together with the “auxiliary” variables that are instead needed, for example, to compute the speed of sound.
The state of system described in [BN86] is actually two Euler states together with the state associated to the volume fraction
- cons_state¶
alias of
josie.bn.state.BaerConsState
- fields¶
alias of
josie.fields.BaerFields
- get_conservative()¶
Returns the conservative part of the state
- Return type
- get_phase(phase)¶
Returns the part of the state associated to a specified
phase
as an instance ofPhaseQ
Warning
This does not return the first variable of the state, i.e.
- Parameters
phase (
Phases
) – APhases
instance identifying the requested phase partition of the state- Returns
A
Q
instance corresponding to the partition of the system associated to the requested phase- Return type
state
- phase_state¶
alias of
josie.bn.state.BaerPhaseState