Commit Graph

80 Commits

Author SHA1 Message Date
e1d6448fcf twoPhaseSolver: Store the flux of the non-solved-for phase
This flux is needed for boundary conditions, post-processing and
Euler-Euler-like sub-models and functions
2023-12-06 12:09:31 +00:00
abe43a9532 thermo: Standardise property names and remove molar functions
All property functions in the low-level templated thermo property
implementations and the high-level virtual interfaces have been made
consistent. All energies and enthalpies are lower case to denote that
they are specific quantities. Molar functions have been removed as these
are no longer used anywhere.
2023-12-01 17:11:59 +00:00
5ab61c60de basicThermo: Make molar mass available to basic thermos 2023-12-01 16:54:08 +00:00
71493091de wallDist: Changed from TopoChangeableMeshObject to DeletableMeshObject
The nearWallDist MeshObject is now deleted on mesh-change rather than updated
which is more efficient for cases with multiple mesh changes, e.g. motion,
stitching and mapping by avoiding unnecessary updates.

As a consequence of this change the wallDist::y() volScalarField reference
should not be cached across mesh changes so the turbulence models now obtain the
y field as required from the new momentumTransportModel::y() function, the
original near-wall distance function is now named momentumTransportModel::yb()
to clarify that it is the wall distance of the boundary cells.
2023-12-01 16:30:01 +00:00
5659e372f3 modules/solid: Calculate DiNum before mesh update
This is consistent with the fluid solvers, and prevents failures
associated with using fields that haven't yet been updated or corrected
following mesh changes
2023-11-29 14:46:35 +00:00
f6f55caf02 Removed "<modelType>Type type" tautology in selection error messages 2023-11-28 16:40:42 +00:00
01d0af39be multiphaseEuler: Added Prandtl heat transfer model
This simple model creates a heat transfer coefficient in proportion with
the corresponding drag model's momentum transfer coefficient. A
user-defined Prandtl number and a harmonic average of the phases'
specific heats are used to specify the constant of proportionality.

This model has no physical basis. It exists primarily for testing
purposes. It has the advantage of being applicable to any interface,
including those representing segregated configurations.

Example usage:

    heatTransfer
    {
        gas_segregatedWith_liquid
        {
            type            Prandtl;
            Pr              0.7;
        }
    }
2023-11-28 12:39:34 +00:00
cef86f598a fieldMapper: Simplification
The patch-specific mapper interfaces, fvPatchFieldMapper and
pointPatchFieldMapper, have been removed as they did not do anything.
Patch mapping constructors and functions now take a basic fieldMapper
reference.

An fvPatchFieldMapper.H header has been provided to aid backwards
compatability so that existing custom boundary conditions continue to
compile.
2023-11-10 14:46:05 +00:00
42e71682cc modules/isothermalFluid: Consistent handling of rhoU_0 and rhoUf_0 2023-11-03 14:03:53 +00:00
0ed84ff137 compressibleVoF,multiphaseEuler: Renamed compressibility dilatation dgdt to vDot
Currently in compressibleVoF vDot contains only the compressibility dilatation
effect whereas in multiphaseEuler the effect of sources are also included but
this will be refactored shortly so that the handling of mass sources and
compressibility is consistent between VoF and Euler-Euler solvers.

The previously hard-coded 1e-4 division stabilisation used when linearising vDot
for bounded semi-implicit solution of the phase-fractions is now an optional
user-input with keyword vDotResidualAlpha, e.g. in multiphaseEuler:

solvers
{
    "alpha.*"
    {
        nAlphaCorr          1;
        nAlphaSubCycles     2;
        vDotResidualAlpha   1e-6;
    }
    .
    .
    .
2023-11-03 13:19:52 +00:00
7ec1e2f1a5 twoPhaseSolver::alphaPredictor: Ensure the Crank-Nicolson blended alpha1 has the same BCs as alpha1
so that compressive interpolations schemes such as PLIC and MPLIC can handle the
BCs appropriately.
2023-11-02 17:10:01 +00:00
95110422a2 multiphaseEuler: Only request pressure from moving phases 2023-10-16 19:42:57 +01:00
6dc6d3d089 phaseSystem::correctKinematics:: Ensure pressure is requested only for moving phase
The pressure field is not available from stationary solid phases.
2023-10-16 19:41:39 +01:00
1845584e09 multiphaseEuler::facePressureCorrector: Request velocity from the first moving phase 2023-10-16 19:38:30 +01:00
e0bdf2405e fvModels: Remove 'Source' from names
The fact that these names create sources in their associated transport
equations is clear in context, so the name does not need to contain
'Source'.

Having 'Source' in the name is a historic convention that dates back to
when fvModels and fvConstraints were combined in a single fvOptions
interface. In this interface, disambiguation between sources and
constraints was necessary.

The full set of name changes is as follows:

                   accelerationSource -> acceleration
                  actuationDiskSource -> actuationDisk
     effectivenessHeatExchangerSource -> effectivenessHeatExchanger
               explicitPorositySource -> porosityForce
            radialActuationDiskSource -> radialActuationDisk
                      rotorDiskSource -> rotorDisk
             sixDoFAccelerationSource -> sixDoFAcceleration
         solidEquilibriumEnergySource -> solidThermalEquilibrium
          solidificationMeltingSource -> solidificationMelting
                 volumeFractionSource -> volumeBlockage
    interRegionExplicitPorositySource -> interRegionPorosityForce
       VoFSolidificationMeltingSource -> VoFSolidificationMelting

The old names are still available for backwards compatibility.
2023-10-13 09:53:32 +01:00
ad3d25dc30 multiphaseEuler::IsothermalSolidPhaseModel: New phase model for isothermal stationary solid phases
IsothermalSolidPhaseModel does not update energy and density from pressure
whereas IsothermalPhaseModel does to allow compressible fluid phases to change
volume due to pressure changes.
2023-10-12 16:24:31 +01:00
5e03874bbb multiphaseEuler: Updated to us the new phaseSolidThermophysicalTransportModel class
for thermophysical transport within stationary solid phases.  This provides a
consistent interface to heat transport within solids for single and now
multiphase solvers so that for example the wallHeatFlux functionObject can now
be used with multiphaseEuler, see tutorials/multiphaseEuler/boilingBed.
Also this development supports anisotropic thermal conductivity within the
stationary solid regions which was not possible previously.

The tutorials/multiphaseEuler/bed and tutorials/multiphaseEuler/boilingBed
tutorial cases have been updated for phaseSolidThermophysicalTransportModel by
changing the thermo type in physicalProperties.solid to heSolidThermo.  This
change will need to be made to all multiphaseEuler cases involving stationary
phases.
2023-10-11 14:53:09 +01:00
0951029513 modules/twoPhaseSolver: Include divU into MULES corrector
This improves convergence in situations with substantial source-based
divergence, such as injections and phase changes.
2023-10-06 11:21:14 +01:00
084bd015f1 modules::shockFluid: Clear temporary fluxed if NCC interfaces are updated
Resolves bug-report https://bugs.openfoam.org/view.php?id=4020
2023-10-05 12:37:41 +01:00
a5ea0b41f1 fvModels: Improved interface for mass/volume sources
The interface for fvModels has been modified to improve its application
to "proxy" equations. That is, equations that are not straightforward
statements of conservation laws in OpenFOAM's usual convention.

A standard conservation law typically takes the following form:

    fvMatrix<scalar> psiEqn
    (
        fvm::ddt(alpha, rho, psi)
      + <fluxes>
     ==
        <sources>
    );

A proxy equation, on the other hand, may be a derivation or
rearrangement of a law like this, and may be linearised in terms of a
different variable.

The pressure equation is the most common example of a proxy equation. It
represents a statement of the conservation of volume or mass, but it is
a rearrangement of the original continuity equation, and it has been
linearised in terms of a different variable; the pressure. Another
example is that in the pre-predictor of a VoF solver the
phase-continuity equation is constructed, but it is linearised in terms
of volume fraction rather than density.

In these situations, fvModels sources are now applied by calling:

    fvModels().sourceProxy(<conserved-fields ...>, <equation-field>)

Where <conserved-fields ...> are (alpha, rho, psi), (rho, psi), just
(psi), or are omitted entirely (for volume continuity), and the
<equation-field> is the field associated with the proxy equation. This
produces a source term identical in value to the following call:

    fvModels().source(<conserved-fields ...>)

It is only the linearisation in terms of <equation-field> that differs
between these two calls.

This change permits much greater flexibility in the handling of mass and
volume sources than the previous name-based system did. All the relevant
fields are available, dimensions can be used in the logic to determine
what sources are being constructed, and sources relating to a given
conservation law all share the same function.

This commit adds the functionality for injection-type sources in the
compressibleVoF solver. A following commit will add a volume source
model for use in incompressible solvers.
2023-09-28 09:04:31 +01:00
da442e8eab multiphaseEuler: Replaced pPrime() with pPrimef()
to provide greater flexibility in the treatment of the face pPrime for particle
phase pressure models.
2023-09-22 16:16:49 +01:00
533421f91a multiphaseEuler: Removed redundant files 2023-09-21 13:09:01 +01:00
597121a4a7 multiphaseEuler: Library reorganisation
This change makes multiphaseEuler more consistent with other modules and
makes its sub-libraries less inter-dependent. Some left-over references
to multiphaseEulerFoam have also been removed.
2023-09-15 14:45:26 +01:00
0b321e3eea isothermalFilm: Corrected impingement pressure transfer
The previous implementation was dimensionally inconsistent and was
missing a factor of the VbyA field. This change will, in most cases,
reduce the total impingement pressure contribution.
2023-09-15 12:01:57 +01:00
9c3a404533 multiphaseEuler::cellPressureCorrector: Added p_rgh update before PISO loop
to ensure consistency between p_rgh, p and the current phase densities updated
after the phase energy solution.
2023-09-15 08:13:13 +01:00
6c24251a37 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-09-14 20:53:36 +01:00
c8a63f2da3 multiphaseEuler::phaseSystemSolve: Corrected handling of dilatation effects
in the presence of stationary phases
2023-09-14 20:52:41 +01:00
69ec807f59 wmakeLnInclude: Don't link to files in sub-libraries 2023-09-14 17:21:05 +01:00
020463b64e multiphaseEuler::SolidThermalPhaseModel: New thermal phase model for solid phases
which provides the energy equation specific for stationary solid phases.
2023-09-14 16:33:52 +01:00
7b052fb6a1 multiphaseEuler::phaseInterface: Added stationary phase handling to magUr
This allows moving particle drag models to be used for stationary beds of particles.
2023-09-14 16:32:42 +01:00
2b7c977da5 solvers::functions: Apply maxDeltaT from functions
The functions module now applies time-step restrictions from the
functions that are running, rather than from the sub-solver. The
sub-solver only exists to be constructed so that its data is available
to the functions. It should not affect the solution process in any way.
2023-09-12 10:25:35 +01:00
889b811005 parcelCloud: Renamed volume and mass fractions
A cloud's volume fraction is now generated with parcelCloud::alpha, and
the mass fraction with parcelCloud::Y. This is consistent with the rest
of OpenFOAM.
2023-09-06 12:37:06 +01:00
d6caf68bce multiphaseEuler::correctCoNum: Corrected handling of stationary phases 2023-09-04 13:56:38 +01:00
3516b97a4d multiphaseEuler::setRDeltaT: Loop over the moving phases only to obtain maxPhi 2023-09-04 13:43:25 +01:00
17771b88d5 multiphaseEuler: Simplified using the movingPhase member reference 2023-09-03 16:27:02 +01:00
3c18db77ed multiphaseEuler::StationaryPhaseModel: Replaced functions returning 0 with notImplemented
requiring all parts of the moving phase solution algorithm to loop and operate
on the moving phases only making the code easier to understand and maintain.
2023-09-03 10:21:31 +01:00
ba772c03e6 multiphaseEuler::MomentumTransferPhaseSystem: Only cache the drag coefficients if needed
The virtual mass and face drag coefficients are no longer cached saving some
storage.
2023-09-01 22:55:50 +01:00
6558f63293 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-09-01 13:13:31 +01:00
18200e72a6 multiphaseEuler: Update the virtual-mass force implementation
The central coefficient part of the virtual-mass phase acceleration matrix is
now included in the phase velocity transport central coefficient + drag matrix
so that the all the phase contributions to each phase momentum equation are
handled implicitly and consistently without lagging contribution from the other
phases in either the pressure equation or phase momentum correctors.

This improves the conditioning of the pressure equation and convergence rate of
bubbly-flow cases.
2023-09-01 13:07:00 +01:00
eebd2d46d4 populationBalance: Fix typo 2023-08-31 13:42:53 +01:00
a83f23828b populationBalance: Corrected fraction field registration 2023-08-31 13:28:58 +01:00
a05df4abe0 populationBalance: Standardise default field handling
Population balance size-group fraction 'f<index>.<phase>' fields are now
read from an 'fDefault.<phase>' field if they are not provided
explicitly. This is the same process as is applied to species fractions
or fvDOM rays. The sum-of-fs field 'f.<phase>' is no longer required.

The value of a fraction field and its boundary conditions must now be
specified in the corresponding field file. Value entries are no longer
given in the size group dictionaries in the constant/phaseProperties
file, and an error message will be generated if a value entry is found.

The fraction fields are now numbered programatically, rather than being
named. So, the size-group dictionaries do not require a name any more.

All of the above is also true for any 'kappa<index>.<phase>' fields that
are constructed and solved for as part of a fractal shape model.

The following is an example of a specification of a population balance
with two phases in it:

    populationBalances (bubbles);

    air1
    {
        type            pureIsothermalPhaseModel;
        diameterModel   velocityGroup;
        velocityGroupCoeffs
        {
            populationBalance bubbles;
            shapeModel      spherical;
            sizeGroups
            (
                { dSph 1e-3; } // Size-group #0: Fraction field f0.air1
                { dSph 2e-3; } // ...
                { dSph 3e-3; }
                { dSph 4e-3; }
                { dSph 5e-3; }
            );
        }
        residualAlpha   1e-6;
    }

    air2
    {
        type            pureIsothermalPhaseModel;
        diameterModel   velocityGroup;
        velocityGroupCoeffs
        {
            populationBalance bubbles;
            shapeModel      spherical;
            sizeGroups
            (
                { dSph 6e-3; } // Size-group #5: Fraction field f5.air2
                { dSph 7e-3; } // ...
                { dSph 8e-3; }
                { dSph 9e-3; }
                { dSph 10e-3; }
                { dSph 11e-3; }
                { dSph 12e-3; }
            );
        }
        residualAlpha   1e-6;
    }

Previously a fraction field was constructed automatically using the
boundary condition types from the sum-of-fs field, and the value of both
the internal and boundary field was then overridden by the value setting
provided for the size-group. This procedure doesn't generalise to
boundary conditions other than basic types that store no additional
data, like zeroGradient and fixedValue. More complex boundary conditions
such as inletOutlet and uniformFixedValue are incompatible with this
approach.

This is arguably less convenient than the previous specification, where
the sizes and fractions appeared together in a table-like list in the
sizeGroups entry. In the event that a substantial proportion of the
size-groups have a non-zero initial fraction, writing out all the field
files manually is extremely tedious. To mitigate this somewhat, a
packaged function has been added to initialise the fields given a file
containing a size distribution (see the pipeBend tutorial for an example
of its usage). This function has the same limitations as the previous
code in that it requires all boundary conditions to be default
constructable.

Ultimately, the "correct" fix for the issue of how to set the boundary
conditions conveniently is to create customised inlet-outlet boundary
conditions that determine their field's position within the population
balance and evaluate a distribution to determine the appropriate inlet
value. This work is pending funding.
2023-08-31 12:05:12 +01:00
a0c391b8bd multiphaseEuler: Corrected handling of pRef 2023-08-30 14:16:09 +01:00
a91e7ea6d3 multiphaseEuler::MomentumTransferPhaseSystem::alphaDByAf: Only consider pPrime for moving phases 2023-08-30 13:32:20 +01:00
6054b1fea0 objectRegistry, regIOobject: Added support for automatic re-reading of dependent class
Now with the addition of the optional dependenciesModified() function classes
which depend on other classes which are re-read from file when modified are also
automatically updated via their read() function called by
objectRegistry::readModifiedObjects.

This significantly simplifies the update of the solutionControls and modular
solvers when either the controlDict or fvSolution dictionaries are modified at
run-time.
2023-08-28 20:28:39 +01:00
5fd30443f3 multiphaseEuler: New implicit drag algorithm replaces partial-elimination corrector
The momentum equation central coefficient and drag matrix is formulated,
inverted and used to eliminate the drag terms from each of the phase momentum
equations which are combined for formulate a drag-implicit pressure equation.
This eliminates the lagged drag terms from the previous formulation which
significantly improves convergence for small particle and Euler-VoF high-drag
cases.

It would also be possible to refactor the virtual-mass terms and include the
central coefficients of the phase acceleration terms in the drag matrix before
inversion to further improve the implicitness of the phase momentum-pressure
coupling for bubbly flows.  This work is pending funding.
2023-08-26 10:09:38 +01:00
e3b53f2727 multiphaseEuler: Fix indexing bug in partial elimination 2023-08-16 16:03:32 +01:00
77f0e7fbdc compressibleVoF/fvModels::VoFTurbulenceDamping: corrected documentation
Resolves bug-report https://bugs.openfoam.org/view.php?id=4000
2023-07-29 16:32:08 +01:00
2f579ca041 fluidSolvers: Stabilise rDeltaT calculation
When the flow is stationary (e.g., at the beginning of a run) the
rDeltaT calculation now requires a maxDeltaT setting in the PIMPLE
sub-section of the fvSolution dictionary. This prevents floating point
errors associated with rDeltaT approaching zero.
2023-07-27 12:16:05 +01:00
9cba18a073 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-07-27 10:58:46 +01:00