Commit Graph

6695 Commits

Author SHA1 Message Date
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
0cfc03e14a tutorials/modules/compressibleVoF/ballValve: Added cavitationVolume functionObject
to calculate and log the cavitation volume.
2023-03-31 08:53:14 +01:00
5e8ead4f89 solvers::multiphaseEuler: Print the max and min T only for anisothermalPhases 2023-03-30 17:24:06 +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
21052fdcb1 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-03-29 16:02:54 +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
15e7b64094 Cloud: Corrected mapping for multiple partial topology changes 2023-03-28 15:48:48 +01:00
e5a5e1913c nonConfomalCoupled: Prevent repeated writing of constant/fvMesh/polyFaces 2023-03-28 12:27:59 +01:00
6233f98806 fv::zeroDimensionalMassSource: Support use of multiple sources
The computation of the current and total accumulated mass is now shared
across all zeroDimensionalMassSource models. So, multiple models can be
used simultaneously.
2023-03-28 12:27:56 +01:00
d7e3306761 fv::massSource: Support mass sinks
If a negative mass flow rate is specified, the mass source fvModel will
now remove mass by adding implicit sources to the transport equations.
Properties are thereby removed at their current value. This is stable,
and is analogous to a zero-gradient outlet boundary condition.
2023-03-28 12:27:52 +01:00
8dfffc9d42 regIOobject: Rename objects owned by the registry 2023-03-28 08:38:44 +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
d7fe6a71d1 fvc::ddtCorr: Added support for Euler-Euler multiphase
to allow the multiphase algorithms to be updated to support ddtCorr with
2nd-order ddt schemes.
2023-03-26 23:08:15 +01:00
8590a7ea97 multiphaseEuler::MomentumTransferPhaseSystem: Improved the face drag coefficient adjustment for the continuous phase 2023-03-25 23:16:17 +00:00
7f1933d136 tutorials/modules/multiphaseEuler/titaniaSynthesis*: Updated writeObjects 2023-03-25 17:10:19 +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
92dacbfcf0 tutorials/modules/incompressibleFluid/pitzDailyScalarTransport: Added subSolverTime entry
to make restart simpler
2023-03-25 14:52:24 +00:00
7142917d06 solvers::functions: Added optional subSolverTime controlDict entry
Class
    Foam::solvers::functions

Description
    Solver module to execute the \c functionObjects for a specified solver

    The solver specified by either the \c subSolver or if not present the \c
    solver entry in the \c controlDict is instantiated to provide the physical
    fields needed by the \c functionObjects.  The \c functionObjects are then
    instantiated from the specifications are read from the \c functions entry in
    the \c controlDict and executed in a time-loop also controlled by entries in
    \c controlDict and the \c maxDeltaT() returned by the sub-solver.

    The fields and other objects registered by the sub-solver are set to
    NO_WRITE as they are not changed by the execution of the functionObjects and
    should not be written out each write-time.  Fields and other objects created
    and changed by the execution of the functionObjects are written out.

    When restarting from a time directory which does contain the \c subSolver
    fields the optional \c controlDict entry \c subSolverTime may be provided to
    specify which time the \c subSolver should be instantiated for, after which
    time is reset to \c startTime for the restart.
2023-03-25 14:49:58 +00:00
01f95cf27e tutorials/modules/multiphaseEuler/mixerVessel2D*: Changed to isothermal 2023-03-25 14:06:11 +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
2e761c31ef tutorials/modules/multiphaseEuler/mixerVessel2DMRF: Added missing virtualMass entries
to avoid warning messages
2023-03-24 17:22:11 +00:00
4b6cf83ab0 tutorials/Allrun: Prevent unconfirmed completion for foamDictionary logs 2023-03-23 14:19:11 +00:00
b3d90497c2 decomposePar, reconstructPar: Prevent unnecessary stitching 2023-03-23 10:25:36 +00:00
7cdb206f9a polyMesh::swap: Corrected copy of patch identifier 2023-03-22 14:44:39 +00:00
683aca12f6 fvMeshTopoChangers::meshToMesh: Maintain valid meshes during mapping
The current mesh is now swapped with the new mesh prior to the mapping
of fields and other properties. Previously the new mesh was copied into
the current mesh.

This change means that both meshes are valid during the mapping
operation, and properties of either can be used. It should also now be
be more efficient as a swap operation just exchanges list pointers and
sizes, whilst a copy requires duplicating all the primitive mesh data.
2023-03-22 14:12:28 +00:00
182490e0b2 fvMeshStitcher: Prevent addition of small couplings from interfering with stabilisation
Resolves bug report https://bugs.openfoam.org/view.php?id=3965
2023-03-21 16:12:03 +00:00
00e25bd828 triIntersect: Additional overflow protection in projection solution 2023-03-21 16:11:03 +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
6c19e3dc17 incompressibleFluid: Provide protected access to member functions
to allow the derivation of specialised versions.
2023-03-18 14:49:32 +00:00
5d2ea7db89 tutorials/modules/multiRegion: New sub-directory for all multi-region cases
run with foamMultiRun
2023-03-17 15:47:34 +00:00
8cc00bdfdc tutorials/modules/compressibleVoF/ballValve: Replaced 0/U with 0/U.orig
The velocity field is initialised by potentialFoam
2023-03-17 09:12:14 +00:00
5fb42f1a94 tutorials: Corrected the file format specification for all ascii files 2023-03-16 18:44:08 +00:00
e62ddc2f62 multiphaseEuler::dragModels: Refactored to remove the need for the residualRe entry 2023-03-16 15:51:59 +00:00
496850ebb2 functionObjects::fieldValues::volFieldValue: Added support for VolInternalField
It is now possible to calculate field values of VolInternalFields, e.g. the
cached kEpsilon:G field in the
tutorials/modules/incompressibleFluid/pitzDailySteady case:

    #includeFunc cellMax(kEpsilon:G)
2023-03-15 13:59:29 +00:00
839fc789d5 blockMesh: The 'boundary' entry is now optional
If not present a single default boundary patch will be created.
2023-03-15 11:19:01 +00:00
6ff9a04dd2 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-03-15 11:12:42 +00:00
72b876e566 fvModels::filmToVoFTransfer,VoFtoFilmTransfer: New collaborating fvModels to transfer phase between VoF and film
These two new fvModels operate between a film and a VoF region to transfer film
to the corresponding VoF phase when the film is thick enough to be resolved by
the VoF solver or from the VoF phase to the film when the near-wall resolution
is too low and it is better to treat it as a wall film.

This functionality is equivalent to the VoFPatchTransfer fvModel developed for
the old film implementation but coded in a much more general manner with
implicit treatment of the mass loss from the film or VoF region for better
numerical stability and robustness.

The simple tutorials/modules/CHT/VoFToFilm case is provided to demonstrate a
film being deposited on a surface as the plate is withdrawn from a liquid.  It
is an updated version of the tutorials/modules/compressibleVoF/plateFilm case.
2023-03-15 11:05:00 +00:00
89931bab6c solver modules: Started adding const access to physical state for fvModels 2023-03-15 11:03:02 +00:00
efdcfa9cc8 fvModels::interfaceTurbulenceDamping: Corrected documentation 2023-03-15 09:18:49 +00:00
a188987e36 tutorials/modules/CHT/rivuletBox/0/film/p: Cleaned 2023-03-15 09:18:23 +00:00
388a6f656d fvModels,fvConstraints: Added direct access to the size of the list of models/constraints
This changes allows the use of forAll to loop over the models/constraints.
2023-03-15 09:17:12 +00:00
092968c178 DemandDrivenMeshObject: Removed New(Mesh& mesh)
Const-ness of the object generated or returned is independent of the const-ness
of the mesh.
2023-03-15 09:14:00 +00:00
87b606c45e foamDictionary.C: fixed typo 2023-03-14 11:33:17 +00:00
c5107bc42f surfaceCheck: make the -verbose option do something 2023-03-10 23:05:50 +00:00
17939acb5e surfaceFilm: Reverted filmName -> regionName for backwards compatibility 2023-03-10 15:45:20 +00:00
b3231229f4 mappedPatchBase: Rationalised the names of mapping functions
to improve code comprehensibility:

    distribute -> fromNeigbour
    reverseDistribute -> toNeigbour
2023-03-10 15:10:12 +00:00