Commit Graph

1401 Commits

Author SHA1 Message Date
d2d3e8710f compressibleVoF,compressibleMultiphaseVoF: Moved Uf correction outside the PISO loop
for efficiency
2023-04-14 10:18:23 +01:00
fff11f7b95 boundaryFoam: Updated post-processing of non-Newtonian viscosity
and adding output of omega+
2023-04-12 15:35:43 +01:00
96978e07f4 Minor updates for single precision compilation 2023-04-11 18:07:47 +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
288fc74ff0 multiphaseEuler::virtualMassModel.H: Corrected documentation 2023-04-11 15:48:36 +01:00
2a9b999701 VoFSolver: Fixed use of as yet uninitialised reference 2023-04-11 14:54:04 +01:00
fb052b9d79 solvers: Provided public constant access to state fields 2023-04-08 16:05:39 +01:00
59218933a3 denseParticleFoam: Use Dcf*phid rather than Fdf for consistency 2023-04-08 16:04:42 +01:00
0c08c2888c solvers: Provided public constant access to state fields 2023-04-07 19:55:21 +01:00
983cba0dca solvers::solid,solidDisplacement: Provided public constant access to state fields 2023-04-07 16:47:59 +01:00
2b74f9486f denseParticleFoam: New face-stabilised phase drag formulation
to provide consistent and stable continuous phase velocity solution without
staggering patterns at the boundary with packed regions of dispersed phase.
2023-04-07 14:16:21 +01:00
13562fa31a multiphaseEuler::wallBoiling,IATEwallBoiling: Completed moving to multiphaseThermophysicalTransportModels
to avoid compilation cyclic dependency
2023-04-06 08:06:53 +01:00
05ffb6a6ff Info: Use nl rather than "\n..." to ensure region-prefixed printing 2023-04-05 17:14:24 +01:00
fa296c0454 mappedPatchBase: Fix typo Neigbour -> Neighbour 2023-04-04 16:59:39 +01:00
42d26690ab multiphaseEuler/interfacialModels/dragModels/Gibilaro: Minor efficiency improvement 2023-04-04 16:10:30 +01:00
d33eafe7df multiphaseEuler/interfacialModels: Reverted handling of the continuous phase-fraction
back to the form in the original multiphaseEulerFoam, i.e. using the continuous
phase-fraction directly rather than 1 - dispersed phase fraction.
2023-04-04 14:59:20 +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
91d48d2eb6 multiphaseEuler::cellPressureCorrector: add Kds[phasei] if defined for phasei 2023-04-03 15:02:09 +01:00
e32a449300 applications/solvers: Replaced fvCFD.H with appropriate include files 2023-04-01 19:59:49 +01:00
5048b7e54a applications/solvers: Replaced fvCFD.H with appropriate include files 2023-04-01 19:31:01 +01:00
f6a730f0ac multiphaseEuler::cellPressureCorrector: Use constrainH rather than constrainHbyA 2023-04-01 17:22:14 +01:00
e66484a82d fvCorrectPhi: Wrapper for CorrectPhi to simplify solvers 2023-04-01 16:23:57 +01:00
de174c2b82 solvers: Cache rAU and/or divU fields for CorrectPhi if mesh.topoChanging() 2023-04-01 09:56:52 +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
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
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
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
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
6c19e3dc17 incompressibleFluid: Provide protected access to member functions
to allow the derivation of specialised versions.
2023-03-18 14:49:32 +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
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
b3231229f4 mappedPatchBase: Rationalised the names of mapping functions
to improve code comprehensibility:

    distribute -> fromNeigbour
    reverseDistribute -> toNeigbour
2023-03-10 15:10:12 +00:00
5b9fe57c23 VoFPatchTransfer: Rationalised the names of the cached fields and their origin
required rationalisation of the names of variables and functions in
surfaceFilmModels to clarify which relate to the film region.
2023-03-09 13:58:08 +00:00
0b0957f03d filmSurfaceVelocityFvPatchVectorField: Added option to use the fluid viscous shear stress rather than the simple drag model
Class
    Foam::filmSurfaceVelocityFvPatchVectorField

Description
    Film surface velocity boundary condition

    Evaluates the surface velocity from the shear imposed by the neighbouring
    fluid velocity using either a simple drag model based on the difference
    between the fluid and film velocities multiplied by the coefficient \c Cs or
    if \c Cs is not specified or set to 0 the fluid viscous shear stress.

    The simple model might be used in preference to the fluid viscous shear
    stress model in order to provide some means to include the drag enhancing
    effect of surface ripples, rivulets etc. in the film surface.

Usage
    \table
        Property     | Description             | Required    | Default value
        Cs           | Fluid-film drag coefficient | no | 0
    \endtable

    Example of the boundary condition specification using the simple drag model:
    \verbatim
    <patchName>
    {
        type            filmSurfaceVelocity;
        Cs              0.005;
        value           $internalField;
    }
    \endverbatim

    Example of the boundary condition specification using the fluid stress:
    \verbatim
    <patchName>
    {
        type            filmSurfaceVelocity;
        value           $internalField;
    }
    \endverbatim

See also
    Foam::mixedFvPatchField

SourceFiles
    filmSurfaceVelocityFvPatchVectorField.C
2023-03-08 13:12:08 +00:00
4d63b39e3e foamMultiRun: Added automatic region prefixing to the Info statements in the log
e.g. for the rivuletBox case the output for a time-step now looks like:

film  Courant Number mean: 0.0003701330848 max: 0.1862204919
panel Diffusion Number mean: 0.007352456305 max: 0.1276468109
box   Courant Number mean: 0.006324172752 max: 0.09030825997
      deltaT = 0.001550908752
      Time = 0.08294s

film  diagonal:  Solving for alpha, Initial residual = 0, Final residual = 0, No Iterations 0
film  diagonal:  Solving for alpha, Initial residual = 0, Final residual = 0, No Iterations 0
box   diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
film  DILUPBiCGStab:  Solving for Ux, Initial residual = 0.009869417958, Final residual = 2.132619614e-11, No Iterations 2
film  DILUPBiCGStab:  Solving for Uy, Initial residual = 0.0002799662756, Final residual = 6.101011285e-12, No Iterations 1
film  DILUPBiCGStab:  Solving for Uz, Initial residual = 1, Final residual = 1.854120599e-12, No Iterations 2
box   DILUPBiCGStab:  Solving for Ux, Initial residual = 0.004071057403, Final residual = 4.79249226e-07, No Iterations 1
box   DILUPBiCGStab:  Solving for Uy, Initial residual = 0.006370817152, Final residual = 9.606673696e-07, No Iterations 1
box   DILUPBiCGStab:  Solving for Uz, Initial residual = 0.0158299327, Final residual = 2.104129791e-06, No Iterations 1
film  DILUPBiCGStab:  Solving for e, Initial residual = 0.0002888908396, Final residual = 2.301587523e-11, No Iterations 1
panel GAMG:  Solving for e, Initial residual = 0.00878508958, Final residual = 7.807579738e-12, No Iterations 1
box   DILUPBiCGStab:  Solving for h, Initial residual = 0.004403989559, Final residual = 1.334113552e-06, No Iterations 1
film  DILUPBiCGStab:  Solving for alpha, Initial residual = 0.0002760406755, Final residual = 2.267583256e-14, No Iterations 1
film  time step continuity errors : sum local = 9.01334987e-12, global = 2.296671859e-13, cumulative = 1.907846466e-08
box   GAMG:  Solving for p_rgh, Initial residual = 0.002842335602, Final residual = 1.036572819e-05, No Iterations 4
box   diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
box   time step continuity errors : sum local = 4.538744531e-07, global = 1.922637799e-08, cumulative = -6.612579497e-09
box   GAMG:  Solving for p_rgh, Initial residual = 1.283128787e-05, Final residual = 7.063185653e-07, No Iterations 2
box   diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
box   time step continuity errors : sum local = 3.069629869e-08, global = 3.780547824e-10, cumulative = -6.234524715e-09
      ExecutionTime = 19.382601 s  ClockTime = 20 s

film  Courant Number mean: 0.0003684434169 max: 0.1840342756
panel Diffusion Number mean: 0.007352456305 max: 0.1276468109
box   Courant Number mean: 0.006292704463 max: 0.09016861809
      deltaT = 0.001550908752
      Time = 0.0844909s

where each line printed by each region solver is prefixed by the region name.
Global messages for the time-step and time are just prefixed with spaces to
align them with the region output.
2023-03-08 10:59:13 +00:00
9621cbf704 regionSolvers: Added #include "solver.H" 2023-03-07 15:37:55 +00:00
a0264c98e8 isothermalFilm: write value entry for film-specific BCs
to allow post-processing without loading the isothermalFilm library.
2023-03-07 13:27:41 +00:00
67e692b5a8 foamRun, foamMultiRun: Pre-load the solver libraries before the mesh/meshes are constructed
to ensure that any solver-specific patch types are available before mesh construction.
2023-03-07 13:18:33 +00:00
cbd9903de4 filmSurfaceVelocityFvPatchVectorField: Updated for clang 2023-03-07 08:18:25 +00:00