Commit Graph

1233 Commits

Author SHA1 Message Date
f38fd3e314 solvers::twoPhaseSolver: new base-class for twoPhaseVoFSolver and incompressibleDriftFlux
to separate the interface treatment between VoF and drift-flux and avoid code
duplication.
2023-04-24 21:13:04 +01:00
b949c295ba solvers::incompressibleDriftFlux: New solver module for two-phase flow with drift-flux
executed with foamRun for single region simulations of foamMultiRun for
multi-region simulations.  Replaces driftFluxFoam and all the corresponding
tutorials have been updated and moved to
tutorials/modules/incompressibleDriftFlux.

Class
    Foam::solvers::incompressibleDriftFlux

Description
    Solver module for 2 incompressible fluids using the mixture approach with
    the drift-flux approximation for relative motion of the phases, with
    optional mesh motion and mesh topology changes including adaptive
    re-meshing.

    The momentum and other fluid properties are of the "mixture" and a single
    momentum equation is solved with mixture transport modelling in which a
    single laminar, RAS or LES model is selected to model the momentum stress.

    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, Lagrangian
    particles, surface film etc. and constraining or limiting the solution.

SourceFiles
    incompressibleDriftFlux.C

See also
    Foam::solvers::VoFSolver
    Foam::solvers::twoPhaseVoFSolver
    Foam::solvers::compressibleVoF
2023-04-22 09:00:41 +01:00
9cdd2a3e7a fvConstraints, fvModels: zeroDimensionalFixedPressure
A constraint and a model have been added, both called
zeroDimensionalFixedPressure, that together act to maintain a pressure
constraint in a zero-dimensional case. These must be used
simultaneously. The desired pressure can be specified as a time-varying
Function1.

These replace the pressureConstraintSource, which has been removed.

The new classes operate by obtaining the residual of the complete
pressure equation, and using that to calculate the mass or volume
sources that need adding to the fluid in order to maintain the
constraint. This process is far more convergent than the previous
approach, it does not require the fluid to have a certain thermodynamic
model, and it is generalisable to multiphase.

This functionality requires only minimal specification. The constraint
contains all the settings and should be specified in
system/fvConstraints as follows:

    zeroDimensionalFixedPressure1
    {
        type            zeroDimensionalFixedPressure;

        // Name of the pressure field, default = p
        //p               p;

        // Name of the density field, default = rho
        //rho             rho;

        // Constant pressure value
        pressure        1e5;

        //// Time-varying pressure value
        //pressure
        //{
        //    type            table;
        //    values
        //    (
        //        (0 1e5)
        //        (1 1e5)
        //        (1.1 1.4e5)
        //        (10 1.4e5)
        //    );
        //}
    }

The model is then added to constant/fvModels, and requires no settings:

    zeroDimensionalFixedPressure1
    {
        type            zeroDimensionalFixedPressure;
    }
2023-04-20 10:26:47 +01:00
060690b6fa driftFluxFoam: Updated in preparation for conversion into a solver module 2023-04-18 16:28:19 +01:00
050c617d3b tutorials/modules/compressibleVoF/throttle/system/fvConstraints: Updated to improve stability 2023-04-18 16:27:31 +01:00
776ecc9a40 solvers::compressibleVoF: Updated to supersede cavitatingFoam
compressibleVoF supports cavitation fvModels which provide a more physical and
controllable approach to cavitation modelling than the simple homogeneous
equilibrium approximation used in cavitatingFoam.

The tutorials/multiphase/cavitatingFoam/RAS/throttle case has been converted to
tutorials/modules/compressibleVoF/throttle which demonstrates how to update
cases from cavitatingFoam to compressibleVoF.

A cavitatingFoam script is provided to redirect users to update their cases to
compressibleVoF.
2023-04-18 09:42:32 +01:00
5bcca1cca9 compressibleVoF,compressibleMultiphaseVoF: Apply fvConstraints to the pressure
Replaces the hard-coded pMin.
2023-04-17 10:32:32 +01:00
e40198353b solvers::incompressibleDenseParticleFluid: New solver module for particle laden incompressible flow
executed with foamRun for single region simulations of foamMultiRun for
multi-region simulations.  Replaces denseParticleFoam and all the corresponding
tutorials have been updated and moved to
tutorials/modules/incompressibleDenseParticleFluid.

Class
    Foam::solvers::incompressibleDenseParticleFluid

Description

    Solver module for transient flow of incompressible isothermal fluids coupled
    with particle clouds including the effect of the volume fraction of
    particles on the continuous phase, with optional mesh motion and change.

    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, constraining or limiting
    the solution.
2023-04-11 16:56:13 +01:00
2f0346d68e libwaves.so: Now included in the alpha and U wave BC specification
rather than in controlDict.
2023-04-06 09:55:13 +01:00
f1a57dde9c tutorials/modules/incompressibleFluid/channel395/system/postChannelDict: Removed
The postChannel utility has been replaced by the more flexible layerAverage
functionObject.
2023-04-06 09:27:53 +01:00
28e581831c tutorials: mixerVessel2D: Consistency improvements
Horizontal mixers have been renamed to mixerVesselHorizontal2D. The
incompressible mixerVessel2D has been reinstated to provide a comparison
with the corresponding MRF case. All rotational speeds have been
standardised at 60 rpm, except for the compressible case in which the
higher speed is justified in order to demonstrate the simulation of
compressibility effects.
2023-04-05 11:01:20 +01:00
9e0373cc12 codedFunctionObjectTemplate: Added #include "volFields.H"
The codedFunctionObjectTemplate is based on regionFunctionObject requiring
fvMesh.H and most manipulate volFields so it makes sense for volFields.H to be
included by default.
2023-04-02 10:41:22 +01:00
0e8c5edada tutorials/modules/incompressibleFluid/pitzDailyScalarTransport/system/controlDict: Added volFields.H 2023-04-01 22:53:46 +01:00
cd8ab17ea5 tutorials/modules/incompressibleFluid/blockedChannel/system/generateAlphas: Added volFields.H 2023-04-01 22:22:56 +01:00
d5023b907f applications/utilities: Replaced fvCFD.H with appropriate include files 2023-04-01 18:59:28 +01:00
e66484a82d fvCorrectPhi: Wrapper for CorrectPhi to simplify solvers 2023-04-01 16:23:57 +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
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
7f1933d136 tutorials/modules/multiphaseEuler/titaniaSynthesis*: Updated writeObjects 2023-03-25 17:10:19 +00:00
92dacbfcf0 tutorials/modules/incompressibleFluid/pitzDailyScalarTransport: Added subSolverTime entry
to make restart simpler
2023-03-25 14:52:24 +00:00
01f95cf27e tutorials/modules/multiphaseEuler/mixerVessel2D*: Changed to isothermal 2023-03-25 14:06:11 +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
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
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
a188987e36 tutorials/modules/CHT/rivuletBox/0/film/p: Cleaned 2023-03-15 09:18:23 +00:00
8397d21905 tutorials/modules: Updated the film tutorials to avoid the need to pre-load libisothermalFilm.so 2023-03-08 10:57:43 +00:00
cee34fea3c tutorials/modules/CHT/rivuletBox: New CHT/film/fluid tutorial case
Demonstration case for three region coupling with film consisting of an
aluminium panel with surface film running down forming rivulets in a box of air
which moved due to buoyancy with 6-way thermal and velocity coupling between the
panel<->film<->air<->panel.  The case runs serial and parallel with arbitrary
decomposition.

Currently extrudeToRegionMesh does not directly support three region coupling so
foamDictionary is used to edit the of the boundary files of box and film regions
to add box<->film coupling.
2023-03-07 13:28:50 +00:00
9df3600f11 tutorials/modules/film/rivuletPanel/Allrun: Corrected for Alltest 2023-03-03 14:50:29 +00:00
25dd524c84 generic.*Patch: Moved to new genericPatches library
genericPatches is linked into mesh generation and manipulation utilities but not
solvers so that the solvers now check for the availability of the specified
patch types.  Bugs in the tutorials exposed by this check have been corrected.
2023-03-03 09:03:47 +00:00
7cc5cba5b4 tutorials/modules/CHT/rivuletPanel: Renamed extrudeToRegionMeshDict 2023-03-02 18:56:57 +00:00
796cfb3b3a solvers::film: new solver module to simulate thermal liquid films and CHT
Class
    Foam::solvers::film

Description
    Solver module for flow of compressible liquid films

    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, Lagrangian particles,
    radiation, surface film etc. and constraining or limiting the solution.

solvers::film is derived from solvers::isothermalFilm adding an energy equation
and temperature update with support for heat transfer to the wall using the
standard ThermophysicalTransportModels library utilising the filmWall patch type
or mappedFilmWall for CHT heat transfer to the adjacent solid region.  A huge
advantage of this consistency with the rest of OpenFOAM is that the standard
thermal coupled boundary conditions can be used without modification, e.g.
temperatureCoupled.

Two variants of the rivuletPanel tutorial case are provided,
tutorials/modules/film/rivuletPanel demonstrates heat transfer to a fixed
temperature wall and tutorials/modules/CHT/rivuletPanel demonstrates conjugate
heat transfer to a thin aluminium panel simulated in a region using the
solvers::solid solver executed with solvers::film using foamMultiRun.

More functionality will be added through the power of fvModels.
2023-02-28 19:33:12 +00:00
dcbd54c131 solvers::isothermalFilm: New solver module to simulate isothermal liquid films
Class
    Foam::solvers::isothermalFilm

Description
    Solver module for flow of compressible isothermal liquid films

    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, Lagrangian
    particles, surface film etc. and constraining or limiting the solution.

The implementation of this new film solver is in fully conservative form,
solving for the film volume-fraction rather film thickness which ensures
conservation on curved and irregular surfaces and even around corners.

Also the formulation is consistent with standard FV solvers in other fundamental
respects using boundary conditions rather than volume forces to apply surface
stresses and transfers.  This hugely advantageous approach, which allows the
reuse of many of the standard OpenFOAM libraries, in particular standard
compressibleMomentumTransportModels for the wall and internal film stresses, is
achieved using the special patch types filmWall and filmSurface to handle the
difference between the film thickness and the film cell layer height.

The specification of physical properties, boundary conditions, optional models
etc. etc. is handled in the same manner as all the other solver modules, making
much easier to use and to maintain the code.

Currently only coupling to the wall is supported with laminar transport, surface
tension, a new and more accurate contact angle algorithm and gravity which is
sufficient to demonstrate rivulet flow for example as in the tutorial case
provided: tutorials/modules/isothermalFilm/rivuletPanel

Support for coupling to an adjacent fluid region, Lagrangian impingement and
ejection, transfer to and from a VoF phase etc. will be added in the future via
the standard fvModels interface.
2023-02-28 19:16:49 +00:00
5a54b126e3 tutorials/modules/incompressibleVoF/capillaryRise/0/alpha.water.orig: Updated contactAngle BC 2023-02-28 16:24:28 +00:00
da062f389d tutorials: compressibleVoF/ballValve: Corrected name of cavitation model 2023-02-28 09:17:05 +00:00
ea8a922ee8 tutorials/modules/CHT: Removed unnecessary files and entries 2023-02-26 19:45:15 +00:00
a004189e35 tutorials::extrudeMeshDict: Corrected object name 2023-02-26 19:44:48 +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
2cf966de89 tutorials: Examples of mapFieldsPar usage
Two pitzDaily variants have been added; pitzDailySteadyMappedToPart, and
pitzDailySteadyMappedToRefined. These demonstrate usage of workflows
which involve mapping between cases with mapFieldsPar.

The pitzDailySteadyMappedToPart case demonstrates mapping onto a small
section of the mesh; in this case in the vicinity of the the corner of
the backstep. This mesh is not consistent with the source data, so
fields are required in the zero directory and cutting patches are used
to specify the properties at the inlets.

The pitzDailySteadyMappedToRefined case demonstrates mapping onto a
geometrically similar case with a different mesh density. This mesh is
consistent with the source, so no fields are needed and no cutting
patches are used. This case does, however, perturb the geometry of the
block mesh a bit, so that some of the refined case is not overlapping
the original case. This provides a test of the stabilisation
procedures within the mesh-to-mesh mapping functions.
2023-02-16 15:15:24 +00:00
f95eb5fd11 meshToMesh, mapFieldsPar: Rationalisation
Cell-to-cell interpolation has been moved to a hierarchy separate from
meshToMesh, called cellsToCells. The meshToMesh class is now a
combination of a cellsToCells object and multiple patchToPatch objects.
This means that when only cell-to-cell interpolation is needed a basic
cellsToCells object can be selected.

Cell-to-cell and vol-field-to-vol-field interpolation now has two well
defined sets of functions, with a clear distinction in how weights that
do not sum to unity are handled. Non-unity weights are either
normalised, or a left-over field is provided with which to complete the
weighted sum.

The left-over approach is now consistently applied in mapFieldsPar,
across both the internal and patch fields, if mapping onto an existing
field in the target case. Warning are now generated for invalid
combinations of settings, such as mapping between inconsistent meshes
without a pre-existing target field.

All mapping functions now take fields as const references and return tmp
fields. This avoids the pattern in which non-const fields are provided
which relate to the source, and at some point in the function transfer
to the target. This pattern is difficult to reason about and does not
provide any actual computational advantage, as the fields invariably get
re-allocated as part of the process anyway.

MeshToMesh no longer stores the cutting patches. The set of cutting
patches is not needed anywhere except at the point of mapping a field,
so it is now supplied to the mapping functions as an argument.

The meshToMesh topology changer no longer supports cutting patch
information. This did not previously work. Cutting patches either get
generated as calculated, or they require a pre-existing field to specify
their boundary condition. Neither of these options is suitable for a
run-time mesh change.

More code has been shared with patchToPatch, reducing duplication.
2023-02-16 11:12:36 +00:00
029f58f433 multiphaseEuler: sphericalDiffusiveMassTransfer: Removed unused Lewis number setting 2023-02-09 16:49:34 +00:00
d913607f3d tutorials/modules/incompressibleVoF/damBreakWithObstacle: Added relaxation for stability 2023-02-08 19:16:09 +00:00
61c1d096a5 tutorials/modules/incompressibleVoF/sloshingTank3D3DoF: Set pressure reference to 0 2023-02-07 17:07:17 +00:00
0d49a11326 fvMeshTopoChangersRefiner: The correctFluxes entry in dynamicMeshDict is now optional
Solvers ensure fluxes are maintained and updated correctly after topology change
and it no longer the responsibility of fvMeshTopoChangersRefiner to attempt
this.
2023-02-07 17:05:45 +00:00
d1cb329706 tutorials: movingCone: Corrected and simplified
The '-region' option has been leveraged to significantly simplify the
meshing and decomposition in the movingCone cases. These cases have also
been corrected to restore the variation in decomposition between the
different meshes, which is important for thoroughly testing the patch
field mapping. The shockFluid case has also had its duration extended a
little in order to span the final mesh mapping time.
2023-02-07 16:14:30 +00:00
6ac8680e8c PDRFoamAutoRefine: Removed
The method to update phi in PDRFoamAutoRefine has been superseded by rhoUf in
all other compressible solvers and PDRFoam needs to be updated, requiring
funding.  PDRFoamAutoRefine is no longer maintained.
2023-02-07 14:58:02 +00:00