Commit Graph

44 Commits

Author SHA1 Message Date
7d2208b735 multiphaseEuler::MovingPhaseModel: Read alphaRhoPhi if present and auto write
Needed by the phaseScalarTransport functionObject and other phase
post-processing tools.
2023-05-12 11:05:14 +01:00
26f93274fb multiphaseEuler: Remove duplicate writing of partitioningModel for liquidPhase in boiling BC
Patch contributed by Timo Niemi, VTT.
2023-05-04 16:25:19 +01:00
fb052b9d79 solvers: Provided public constant access to state fields 2023-04-08 16:05:39 +01:00
13562fa31a multiphaseEuler::wallBoiling,IATEwallBoiling: Completed moving to multiphaseThermophysicalTransportModels
to avoid compilation cyclic dependency
2023-04-06 08:06:53 +01:00
b414884142 solvers::multiphaseEuler::cellPressureCorrector: Use near-wall drag coefficient at wall patch
Avoids numerical imbalance between forces at wall patches normal to gravity for
phases with zero phase fraction.
2023-04-04 09:41:47 +01:00
e66484a82d fvCorrectPhi: Wrapper for CorrectPhi to simplify solvers 2023-04-01 16:23:57 +01:00
aa0b101cad MomentumTransferPhaseSystem: Removed unnecessary caching of D 2023-03-31 11:54:34 +01:00
e33b53c7c7 CorrectPhi: Change the divU argument to autoPtr<volScalarField>
If divU is valid the velocity divergence is included in the pcorr equation.
This simplifies the logic in multiphase moveMesh functions supporting
incompressible (with or without mass sources) and compressible fluids.
2023-03-31 08:53:59 +01:00
0641b16f1a solvers::multiphaseEuler::phaseSystem::ddtCorrs: Removed unused argument 2023-03-30 16:03:58 +01:00
a8cb8a61da solvers::multiphaseEuler: New cell momentum/pressure algorithm
The cell-base momentum/pressure algorithm in the multiphaseEuler solver module
has been substantially updated to improve consistency, conservation and reduce
drag generated staggering patterns at sharp interfaces and the boundaries with
stationary phases.  For most if not all cases this new algorithm can be used to
provide well resolved and reliable solutions where the faceMomentum algorithm
would have been chosen previously in order to obtain sufficiently smooth
solutions but at the expense of a noticeable loss in accuracy and resolution.

The first significant change in the momentum/pressure algorithm is in the
interpolation practice used to construct the flux predictor equation from the
cell momentum equation: rather than interpolating the H/A ratio to the faces
i.e. (H/A)_f the terms in the momentum equation are interpolated separately so
that H_f/A_f is used.  The same approach is used for the drag i.e. (D_f/A_f) and
virtual mass contributions.  The advantage of this change is that the phase
forces are now consistent in both the momentum and flux equations, i.e. sum to
zero for each pair of phases.

The second significant change is in the handling of ddtCorr which converts the
old-time time-derivative contributions in H from velocity to flux which is now
consistent due to the change to H/A interpolation and also generalised to use
the fvc::ddtCorr function which has been updated for multiphase.  Additionally
ddtCorr may optionally be applied to the time-derivative in the virtual mass
term in a consistent manner so that the contributions to the flux equation sum
to zero for each pair of phases.

The third significant change is the addition of an optional drag correction term
to the momentum corrector to reduce the staggering patters generated in the
velocity field due to sudden changes in drag force between phase, e.g. at sharp
interfaces between phases or at the boundaries with stationary phases.  This is
particularly beneficial for fluidised bed simulations.  However this correction
is not and cannot be phase consistent, i.e. the correction does not sum to zero
for pairs of phases it is applied to so a small drag error is introduced, but
tests so far have shown that the error is small and outweighed by the benefit in
the reduction in numerical artefacts in the solution.

The final significant change is in the handling of residualAlpha for drag and
virtual mass to provide stable and physical phase velocities in the limit of the
phase-fraction -> 0.  The new approach is phase asymmetric such that the
residual drag is applied only to the phase with a phase-fraction less than
residualAlpha and not to the carrier phase.  This change ensures that the flow
of a pure phase is unaffected by the residualAlpha and residual drag of the
other phases that are stabilised in pure phase region.

There are now four options in the PIMPLE section of the fvSolutions dictionary
relating to the multiphase momentum/pressure algorithm:

PIMPLE
{
    faceMomentum        no;
    VmDdtCorrection     yes;
    dragCorrection      yes;
    partialElimination  no;
}

faceMomentum:
    Switches between the cell and face momentum equation algorithms.
    Provides much smoother and reliable solutions for even the most challenging
    multiphase cases at the expense of a noticeable loss in accuracy and resolution.
    Defaults to 'no'.

VmDdtCorrection:
    Includes the ddtCorr correction term to the time-derivative part of the
    virtual-mass term in the flux equation which ensures consistency between the
    phase virtual mass force on the faces but generates solutions which are
    slightly less smooth and more likely to contain numerical artefacts.
    Defaults to 'no'.

    Testing so far has shown that the loss in smoothness is small and there is
    some noticeable improvement is some cases so in the future the default may
    be changed to 'yes'.

dragCorrection:
    Includes the momentum corrector drag correction term to reduce the
    staggering patters generated in the velocity field due to sudden changes in
    drag force at the expense of a small error in drag consistency.
    Defaults to 'no'

partialElimination:
    Switches the partial-elimination momentum corrector which inverts the drag
    matrix for both the momentum equations and/or flux equations to provide a
    drag implicit correction to the phase velocity and flux fields.  The
    algorithm is the same as previously but updated for the new consistent drag
    interpolation.

All the tutorials/modules/multiphaseEuler tutorial cases have been updated and
tested with the above developments and the four options set appropriately for
each.
2023-03-30 12:27:48 +01:00
113d07862c solvers::multiphase: Improved CorrectPhi handling for compressible multiphase flows
The mixture compressibility/density is now included in CorrectPhi for
compressible mixtures, consistent with the compressibility handling in the
pressure equation.  This improves consistency, robustness and convergence of the
pcorr equation.
2023-03-29 15:59:13 +01:00
f67445212d multiphaseEuler: Adjust the drag coefficients for the continuous phase in partialElimination
so that the residualAlpha applied to stabilised the dispersed phase does not
affect the continuous phase in the limit of it becoming pure with or without
partial-elimination.
2023-03-27 10:55:55 +01:00
8590a7ea97 multiphaseEuler::MomentumTransferPhaseSystem: Improved the face drag coefficient adjustment for the continuous phase 2023-03-25 23:16:17 +00:00
f4eee20b97 multiphaseEuler: Adjust the drag and heat transfer coefficients for the continuous phase
so that the residualAlpha applied to stabilised the dispersed phase does not
affect the continuous phase in the limit of it becoming pure.
2023-03-25 16:51:07 +00:00
7b4002fec2 solvers::*:moveMesh: rationalised the application of correctPhi
Flux correction is now applied if either the topology changed or the mesh is
moving and correctPhi is true.  This strategy allows moving mesh cases without
topology change to be run without any change to the fluxes which is appropriate
for solid-body motion of the entire domain or a rotating sub-domain with NCC.
2023-03-25 15:36:09 +00:00
b228cc539f multiphaseEuler::MovingPhaseModel: Read alphaRhoPhi if present and auto write
Needed by the phaseScalarTransport functionObject and other phase
post-processing tools.
2023-03-24 19:52:02 +00:00
e98dcc5aa8 solvers: Added ddtCorr support in MRF regions by extending the use of Uf and rhoUf
to provide the old-time absolute flux.  This avoids possible
pressure-velocity-flux decoupling (staggering) within the MRF region using
ddtCorr to better couple the velocity and flux fields.
2023-03-24 17:23:14 +00:00
ede5ec4830 multiphaseEuler: Create the drag and virtual mass tables on demand
reduces storage and unnecessary evaluation of unused tables.
2023-03-18 14:50:19 +00:00
32edc48db2 solvers: multiphaseEuler: Boiling on the surface of a stationary phase
A new wallBoiling heat transfer model has been added for use with the
thermalPhaseChangeMultiphaseSystem. This model operates similarly to the
alphatWallBoilingWallFunction. The difference is that the boiling generated by
the wallBoiling heat transfer model occurs on the surface of a third stationary
phase, within the volume of the simulation, rather than on a wall patch. This
can be used to model boiling within a packed bed or similar.

The wallBoiling heat transfer model and the alphatWallBoilingWallFunction share
underlying sub-models, so their specification is very similar. For example, in
constant/phaseProperties:

heatTransfer
{
    ...

    bed_dispersedIn_liquid_inThe_liquid
    {
        type            wallBoiling;

        liquidPhase     liquid;
        vapourPhase     gas;

        heatTransferModel
        {
            type            Gunn;
        }

        partitioningModel
        {
            type            Lavieville; // phaseFraction, linear, cosine
            alphaCrit       0.2;
        }
        nucleationSiteModel
        {
            type            LemmertChawla; // KocamustafaogullariIshii
        }
        departureDiameterModel
        {
            type            TolubinskiKostanchuk; // KocamustafaogullariIshii
        }
        departureFrequencyModel
        {
            type            KocamustafaogullariIshii; // Cole
            Cf              1.18;
        }
    }

    bed_dispersedIn_liquid_inThe_bed
    {
        type            spherical;
    }

    ...
}

Based on a patch contributed by Juho Peltola, VTT.
2023-03-03 14:23:51 +00:00
6cac79b47b Reorganised linkage to avoid link errors from foamToC -allLibs 2023-02-24 22:40:12 +00:00
83e5c45764 contactAngleModels: New contact angle models library
used in the alphaContactAngleFvPatchScalarField boundary condition to replace
the need to derive specialised versions for different contact angle evaluation
methods.  This simplifies the code and provides a reusable system which could be
applied to other multiphase contact angle boundary conditions.
2023-02-24 15:35:25 +00:00
aeadea4377 Standardised name of area-per-unit-volume to Av
This change applies to diameter models within the multiphaseEuler
module, heat transfer fvModels, and the LopesdaCosta porosity and
turbulence models.

User input changes have been made backwards-compatible, so existing
AoV/a/Sigma/... entries and fields should continue to work.
2023-02-22 12:58:14 +00:00
1321112963 ThermalPhaseChangePhaseSystem: Changes to latent heat handling
Latent heat evaluation has been changed to calculate both sides' heats
similarly using the interface temperature, rather than using bulk
quantities on the "upwind" side of the mass transfer process
(latentHeatScheme::symmetric vs latentHeatScheme::upwind).

The transfer of heat has been changed so that it is calculated from the
mass transfer rate rather than the heat transfer coefficients and
temperatures (latentHeatTransfer::mass vs latentHeatTransfer::heat).

These changes were found to improve stability characteristics in some
boiling cases, and in general should be more energy conservative and
less dependent on the accuracy of the interfacial temeprature solution.

Patch contributed by Juho Peltola, VTT.
2023-02-17 15:18:13 +00:00
f862b5142d solvers::multiphaseEuler: Reorganised thermophysicalPredictor
To ensure transport consistency between the composition and energy both must be
included in the optional energy corrector loop.
2023-02-10 12:49:35 +00:00
4dbc23c141 ListOps::identity -> identityMap
to avoid confusion with the tensor identity.
2023-02-03 17:12:31 +00:00
c44a9d1097 populationBalanceModel: Stabilise dilatation error term
A small SuSp stabilisation has been added to the dilation error term to
prevent edge-cases in which the dilation correction exactly cancels out
all implicit transport terms and sources.
2023-01-24 14:10:59 +00:00
377080de52 compressible::alphatWallBoilingWallFunction: Improved solution procedure
This boundary condition now solves for the wall temperature by interval
bisection, which should be significantly more robust than the previous
fixed-point iteration procedure. There is a new non-dimensional
"tolerance" setting that controls how tightly this solution procedure
solves the wall temperature. The "relax" setting is no longer used.

The boundary condition no longer triggers re-evaluation of the
temperature condition in order to re-calculate the heat flux within the
solution iteration. Instead, it extracts physical coefficients from the
form of the boundary condition and uses these to form a linearised
approximation of the heat flux. This is a more general approach, and
will not trigger side-effects associated with re-evaluating the
temperature condition.

The fixedMultiphaseHeatFlux condition has been replaced by a
uniformFixedMultiphaseHeatFlux condition, which constructs a mixed
constraint which portions a specified heat flux between the phases in
such a way as to keep the boundary temperature uniform across all
phases. This can be applied to all phases. It is no longer necessary to
apply a heat flux model to one "master" phase, then map the resulting
temperature to the others. An example specification of this boundary
condition is as follows:

    wall
    {
        type            uniformFixedMultiphaseHeatFlux;
        q               1000;
        relax           0.3;
        value           $internalField;
    }

The wall boiling tutorials have been updated to use these new functions,
and time-varying heat input has been used to replace the
stop-modify-restart pattern present in the single-region cases.
2023-01-24 10:28:59 +00:00
022519fcf3 multiphaseEuler::populationBalanceModel: Make precomputation of diameter-independent expressions depend on the source term update interval
Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
and VTT Technical Research Centre of Finland Ltd.
2023-01-18 14:52:44 +00:00
ec7afd8386 alphatPhaseChangeWallFunctions: Clean up
The fixedDmdt phase change boundary condition has been removed as this
is not a physical model and was only ever needed for testing.

The phase change wall function interface has been simplified and made a
mix-in, rather than a derivation from a fixed value patch field. This
reduces forwarding and mapping code and permits wall functions to derive
from patch fields other than fixed value.

Minor style and consisteny improvements have been made to the wall
boiling wall function.
2023-01-13 14:25:56 +00:00
7f1fb2fb11 PtrListDictionary: Added conversion to UPtrListDictionary with dynamic up-casting of pointers 2023-01-09 19:58:06 +00:00
167c207e49 incompressiblePhase, compressiblePhase: Refactored using the new phase base-class
used in the incompressibleMultiphaseMixture and compressibleMultiphaseMixture
respectively which are used in multiphaseInterFoam and
compressibleMultiphaseInterFoam respectively.

Also the PtrDictionary of phases has been replaced by PtrListDictionary of
phases and iterations over the linked-list replaced by forAll loops which is
easier to use and consistent with the multiphaseEuler solver module.
2023-01-08 16:22:06 +00:00
6d1758167d incompressibleTwoPhaseMixture, compressibleTwoPhaseMixture: Moved into incompressibleVoF and compressibleVoF
simplifying the src/twoPhaseModels libraries
2023-01-05 17:02:44 +00:00
b7ea5fcc29 solvers::XiFluid: New solver module for compressible premixed/partially-premixed combustion
executed with foamRun for single region simulations of foamMultiRun for
multi-region simulations.  Replaces XiFoam and all the corresponding
tutorials have been updated and moved to tutorials/modules/XiFluid.

Class
    Foam::solvers::XiFluid

Description
    Solver module for compressible premixed/partially-premixed combustion with
    turbulence modelling.

    Combusting RANS code using the b-Xi two-equation model.
    Xi may be obtained by either the solution of the Xi transport
    equation or from an algebraic expression.  Both approaches are
    based on Gulder's flame speed correlation which has been shown
    to be appropriate by comparison with the results from the
    spectral model.

    Strain effects are encorporated directly into the Xi equation
    but not in the algebraic approximation.  Further work need to be
    done on this issue, particularly regarding the enhanced removal rate
    caused by flame compression.  Analysis using results of the spectral
    model will be required.

    For cases involving very lean Propane flames or other flames which are
    very strain-sensitive, a transport equation for the laminar flame
    speed is present.  This equation is derived using heuristic arguments
    involving the strain time scale and the strain-rate at extinction.
    the transport velocity is the same as that for the Xi equation.

    Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
    pseudo-transient and steady simulations.

    Optional fvModels and fvConstraints are provided to enhance the simulation
    in many ways including adding various sources, chemical reactions,
    combustion, Lagrangian particles, radiation, surface film etc. and
    constraining or limiting the solution.

    Reference:
    \verbatim
        Greenshields, C. J., & Weller, H. G. (2022).
        Notes on Computational Fluid Dynamics: General Principles.
        CFD Direct Ltd.: Reading, UK.
    \endverbatim

SourceFiles
    XiFluid.C

See also
    Foam::solvers::fluidSolver
    Foam::solvers::isothermalFluid
2022-12-29 23:53:33 +00:00
c1ab4fc165 multiphaseEuler::ThermalPhaseChangePhaseSystem: Corrected diagnostic messages when running in parallel
Patch contributed by Timo Niemi, VTT.
2022-12-22 23:11:41 +00:00
1366eb20f3 multiphaseEuler::MomentumTransferPhaseSystem: Removed optional (1 - phase) prefactor from alphaDByAf
Tests have shown that the alphaDByAf phase-pressure diffusion coefficient
provides better stability without the optional (1 - phase) prefactor without
introducing excessive smearing of the solution.
2022-12-21 12:12:31 +00:00
d9ba28b427 momentumTransportModels: Added a new predict() function in addition to the existing correct() function
Some momentumTransportModels like the laminar Stokes and generalisedNewtonian
models do no solve transport equations and the transport coefficients they
provide can be predicted at the beginning of the time-step rather than corrected
at the end, after conservative fluxes are available.  A particular advantage of
this approach is that complex data cached in the momentumTransportModels
can now be deleted following mesh topology changes and recreated in the
predict() call which is more efficient than attempting to register and map the
data.

Currently the predict() function is only used for the Stokes and
generalisedNewtonian models but it will be extended in the future to cover many
LES models which also do not require the solution of transport equations.

All solvers and solver modules have been update to call the
momentumTransportModel::predict() function at the beginning of the time-step,
controlled by the new PIMPLE transportPredictionFirst control as appropriate.
2022-12-16 10:12:22 +00:00
ce42ebc5d7 thermophysicalTransportModel: added predict() function
None of the current thermophysicalTransportModels solve transport equations in
order to evaluate the thermophysical transport properties so it makes more sense
that the evaluation occurs at the beginning of the time-step rather than at the
end where conservative fluxes are available for transport solution.  To enable
this the correct() functions have been renamed predict() and called in the
prePredictor() step of foamRun and foamMultiRun and at the beginning of the
time-step in the legacy solvers.  A particular advantage of this approach is
that complex data cached in the thermophysicalTransportModels can now be deleted
following mesh topology changes and recreated in the predict() call which is
more efficient than attempting to register and map the data.

An empty correct() function is included in addition to the new predict()
function in thermophysicalTransportModel to support scalar flux transport
closure in the future if needed.

Additionally the two transport model corrector function calls in foamRun and
foamMultiRun have been combined into a single postCorrector() call to allow
greater flexibility in transport property prediction and correction in the
modular solvers.
2022-12-15 14:59:44 +00:00
a6456cdd73 solvers/modules: turbulence -> momentumTransport
Momentum transport in the modular solvers is generalised and run-time
selectable, supporting laminar, generalised laminar or non-Newtonian as well LES
or RAS turbulence modelling so it is clearer to name the momentum transport
model instance 'momentumTransport' rather than 'turbulence'.
2022-12-07 14:45:49 +00:00
be844f8340 MomentumTransferPhaseSystem: Name the interpolation of pPrime consistently between face and cell momentum forms
Simplifies the setting of the scheme for the phase pressure, e.g. choosing localMax

interpolationSchemes
{
    default     linear;
    pPrime      localMax;
}

improves stability and reduces chequerboarding in the solution at higher Courant
numbers.
2022-12-04 15:51:37 +00:00
e8078ca235 multiphaseEuler::MomentumTransferPhaseSystem:alphaDByAf: multiphase consistent replacement for DByAfs
In order that the phase-fractions sum to 1 it is necessary that the same
diffusivity is used for ALL phases in the implicitPhasePressure option.  This is
guaranteed by the new alphaDByAf function which returns a single
surfaceScalarField diffusivity to be used when forming the Laplacian term in the
implicit phase-fraction diffusion correction equation in phaseSystemSolve.

The phase-pressure and turbulent dispersion interface terms are summed over all
phases and interfaces in alphaDByAf to form a single diffusivity.
2022-12-01 21:12:04 +00:00
ed7e703040 Time::timeName(): no longer needed, calls replaced by name()
The timeName() function simply returns the dimensionedScalar::name() which holds
the user-time name of the current time and now that timeName() is no longer
virtual the dimensionedScalar::name() can be called directly.  The timeName()
function implementation is maintained for backward-compatibility.
2022-11-30 15:53:51 +00:00
3aea199ebe multiphaseEuler::IATEsources::IATEturbulentBreakUp: Corrected turbulent Weber number and source expression
Resolves bug-reports:
https://bugs.openfoam.org/view.php?id=3936
https://bugs.openfoam.org/view.php?id=3935
2022-11-28 08:44:56 +00:00
084097bab9 solvers/modules: Updated correctPhi logic so that it is not required following topology change
Now fluxes are updated from the mapped fields following mesh topology change
with or without implicit continuity correction enabled by the optional
correctPhi switch.
2022-11-20 20:22:59 +00:00
29b82422d7 applications/solvers/modules: Reorganised to match the structure of tutorials/modules
Given that the number of solid solver modules is currently 1 and unlikely to
exceed 3 it is not very useful to maintain solid and fluid sub-directories and
easier to see the correspondence between the solver modules and tutorial cases
without.
2022-11-16 23:28:59 +00:00