Commit Graph

7168 Commits

Author SHA1 Message Date
16ecc4fe08 fvConstraints: Remove 'Constraint' from constraint names
The fact that these names refer to constraints is clear in context, so
the name does not need to contain 'Constraint'.

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

This change has been applied to the 'fixedValue' and 'fixedTemperature'
constraints, which were formerly named 'fixedValueConstraint' and
'fixedTemperatureConstraint', respectively.

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
2f018f4156 coefficientMassTransfer: Added prototype fvModel for mass transfer
This simple model generates a mass transfer between two phases
calculated from the following expression:

    \dot{m}/V = C \alpha \grad \alpha

Where:

    \dot{m}/V | mass transfer rate per unit volume
    C         | coefficient
    \alpha    | volume fraction of the source phase

Example usage:

    coefficientMassTransfer
    {
        type            coefficientMassTransfer;

        phases          (liquid vapour);

        C               [kg/m^2/s] 0.1;
    }

This model may be of use in simple situations, but it is primarily
designed to serve as a prototype for more complex and physical
mechanisms of mass transfer between phases.
2023-10-12 11:32:49 +01:00
171101d1e5 fvModels: Specify source property values in field files
When an fvModel source introduces fluid into a simulation it should also
create a corresponding source term for all properties transported into
the domain by that injection. The source is, effectively, an alternative
form of inlet boundary, on which all transported properties need an
inlet value specified.

These values are now specified in the property field files. The
following is an example of a 0/U file in which the velocity of fluid
introduced by a fvModel source called "injection1" is set to a fixed
value of (-1 0 0):

    dimensions      [0 1 -1 0 0 0 0];

    internalField   uniform (0 0 0);

    boundaryField
    {
        #includeEtc "caseDicts/setConstraintTypes"

        wall
        {
            type            noSlip;
        }

        atmosphere
        {
            type            pressureInletOutletVelocity;
            value           $internalField;
        }
    }

    // *** NEW ***
    sources
    {
        injection1
        {
            type            uniformFixedValue;
            uniformValue    (-1 0 0);
        }
    }

And the following entry in the 0/k file specifies the turbulent kinetic
energy introduced as a fraction of the mean flow kinetic energy:

    sources
    {
        injection1
        {
            type            turbulentIntensityKineticEnergy;
            intensity       0.05;
        }
    }

The specification is directly analogous to boundary conditions. The
conditions are run-time selectable and can be concisely implemented.
They can access each other and be inter-dependent (e.g., the above,
where turbulent kinetic energy depends on velocity). The syntax keeps
field data localised and makes the source model (e.g., massSource,
volumeSource, ...) specification independent from what other models and
fields are present in the simulation. The 'fieldValues' entry previously
required by source models is now no longer required.

If source values need specifying and no source condition has been
supplied in the relevant field file then an error will be generated.
This error is similar to that generated for missing boundary conditions.
This replaces the behaviour where sources such as these would introduce
a value of zero, either silently or with a warning. This is now
considered unacceptable. Zero might be a tolerable default for certain
fields (U, k), but is wholly inappropriate for others (T, epsilon, rho).

This change additionally makes it possible to inject fluid into a
multicomponent solver with a specified temperature. Previously, it was
not possible to do this as there was no means of evaluating the energy
of fluid with the injected composition.
2023-10-12 11:24:27 +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
b03fead509 fvModels: radialActuationDiskSource: Removed unused templates file 2023-10-10 10:34:39 +01:00
22d038c178 cylindricalInletVelocityFvPatchVectorField: Updated documentation 2023-10-06 11:28:58 +01:00
755a3db81f cylindricalInletVelocityFvPatchVectorField: Added support for specifying either rpm or omega
Class
    Foam::cylindricalInletVelocityFvPatchVectorField

Description
    This boundary condition describes an inlet vector boundary condition in
    cylindrical co-ordinates given a central axis, central point, rpm, axial
    and radial velocity.

Usage
    \table
        Property     | Description             | Required    | Default value
        axis         | axis of rotation        | yes         |
        origin       | origin of rotation      | yes         |
        axialVelocity | axial velocity profile [m/s] | yes    |
        radialVelocity | radial velocity profile [m/s] | yes  |
        omega        | angular velocity of the frame [rad/s] | no |
        rpm          | angular velocity of the frame [rpm]   | no |
    \endtable

    Example of the boundary condition specification:
    \verbatim
    <patchName>
    {
        type            cylindricalInletVelocity;
        axis            (0 0 1);
        origin          (0 0 0);
        axialVelocity   constant 30;
        radialVelocity  constant -10;
        rpm             constant 100;
    }
    \endverbatim

    Note:
        The \c axialVelocity, \c radialVelocity and \c omega or \c rpm entries
        are Function1 types, able to describe time varying functions.  The
        example above gives the usage for supplying constant values.
2023-10-06 11:27:20 +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
8b2e6b9758 tutorials/multiphaseEuler: Added boilingBed tutorial
This tutorial serves as an example of a boiling transfer between two
phases, which occurs on the surface of a third stationary phase. See
commit 32edc48d for details of this modelling and its specification.

Patch contributed by Juho Peltola, VTT.
2023-09-28 16:06:30 +01:00
9181a699f2 fvModels: Added volumeSource model
This fvModel applies a volume source to the continuity equation and to
all field equations. It can be applied to incompressible solvers, such
as incompressibleFluid and incompressibleVoF. For compressible solvers,
use the massSource model instead.

If the volumetric flow rate is positive then user-supplied fixed
property values are introduced to the field equations. If the volumetric
flow rate is negative then properties are removed at their current
value.

Example usage:

    volumeSource
    {
        type            volumeSource;

        select          cellSet;
        cellSet         volumeSource;

        volumetricFlowRate 1e-4;

        fieldValues
        {
            U               (10 0 0);
            k               0.375;
            epsilon         14.855;
        }
    }

If the volumetric flow rate is positive then values should be provided
for all solved for fields. Warnings will be issued if values are not
provided for fields for which transport equations are solved. Warnings
will also be issued if values are provided for fields which are not
solved for.
2023-09-28 09:04:36 +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
bb127a4523 rigidBodyModel: Removed g from the body acceleration 2023-09-27 21:26:05 +01:00
b7e88c09ac fvMeshTopoChangersMeshToMesh: Reset the meshTime from the timeIndex
to avoid round-off errors at start of cyclic or repeat sequences
2023-09-26 18:41:32 +01:00
4b6eade88c tutorials/incompressibleVoF/damBreak: Simplification of variants 2023-09-26 14:03:48 +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
76afad69ba functionObjects: Updated remaining outputTime -> writeTime 2023-09-22 11:11:55 +01:00
533421f91a multiphaseEuler: Removed redundant files 2023-09-21 13:09:01 +01:00
31203e3ff3 fvMeshTopoChangersMeshToMesh: Use the optional 'local' directory for region 2023-09-20 11:57:26 +01:00
b1d56acb91 tutorials: pitzDailySteadyMapped*: Updated for changes in source case 2023-09-19 14:38:22 +01:00
e23ea3b039 particle: Transfer across NCC-s to the projected location 2023-09-19 11:52:43 +01:00
e5cf0cf4ed Cloud: Accumulate warning messages associated with location failures
Warnings about initialisation of particles with locations outside of the
mesh and about the positional inaccuracy of NCC transfers are now
accumulated and printed once per time-step. This way, the log isn't
obscured by hundreds of such warnings.

Also, the pattern in which warnings are silenced after some arbitrary
number (typically 100) have been issued has been removed. This pattern
means that user viewing the log later in the run may be unaware that a
problem is still present. Accumulated warnings are concise enough that
they do not need to be silenced. They are generated every time-step, and
so remain visible throughout the log.
2023-09-19 10:57:11 +01:00
aaf04f0481 fvMeshTopoChangersMeshToMesh: Updated to support multiple regions
in which the meshToMesh_* directories are located in the constant/<region>
directories.
2023-09-18 15:09:08 +01:00
e7e6d6a3cc tutorials/mesh/refineMesh/sector: Renamed functionObjects for consistency 2023-09-18 11:39:59 +01:00
58cb08d8cd tutorials/incompressibleFluid/pitzDailySteady: Added strainRate coded functionObject
to demonstrate how easy it is to add field post-processing to cases.
2023-09-18 11:38:54 +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
1ff0bcd81b fvMatrix: Corrected type returned by Su method 2023-09-15 12:02:04 +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
8d54ad9ebc foamCreateVideo: correct framerate with ffmpeg 2023-09-14 20:10:57 +01:00
a5db3b5d29 functionObjects: adjustTimeStepToChemistry: Documented phase setting 2023-09-14 17:21:05 +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
3e7ebe0491 functionObjects::/systemCall: Added optional parallel switch to execute on all processors
When the parallel switch is set false (the default), the system call is executed
only on the master processor, if true it is executed on all processors.

Patch contributed by Stanislau Stasheuski, Aalto University.
2023-09-14 13:44:13 +01:00
fca802fa82 fvModels::waveForcing: Added an easier specification of the forcing coefficients
Description
    This fvModel applies forcing to the liquid phase-fraction field and all
    components of the vector field to relax the fields towards those
    calculated from the current wave distribution.

    The force coefficient \f$\lambda\f$ should be set based on the desired level
    of forcing and the residence time the waves through the forcing zone.  For
    example, if waves moving at 2 [m/s] are travelling through a forcing zone 8
    [m] in length, then the residence time is 4 [s]. If it is deemed necessary
    to force for 5 time-scales, then \f$\lambda\f$ should be set to equal 5/(4
    [s]) = 1.2 [1/s].  If more aggressive forcing is required adjacent to the
    boundaries, which is often the case if wave boundary conditions are
    specified at outflow boundaries, the optional \f$\lambdaBoundary\f$
    coefficient can be specified higher than the value of \f$\lambda\f$.

    Alternatively the forcing force coefficient \f$\lambdaCoeff\f$ can be
    specified in which case \f$\lambda\f$ is evaluated by multiplying the
    maximum wave speed by \f$\lambdaCoeff\f$ and dividing by the forcing region
    length.  \f$\lambdaBoundary\f$ is similarly evaluated from
    \f$\lambdaBoundaryCoeff\f$ if specified.

Usage
    Example usage:
    \verbatim
    waveForcing1
    {
        type            waveForcing;

        libs            ("libwaves.so");

        liquidPhase     water;

        // Define the line along which to apply the graduation
        origin          (600 0 0);
        direction       (-1 0 0);

        // // Or, define multiple lines
        // origins         ((600 0 0) (600 -300 0) (600 300 0));
        // directions      ((-1 0 0) (0 1 0) (0 -1 0));

        scale
        {
            type        halfCosineRamp;
            start       0;
            duration    300;
        }

        lambdaCoeff     2;   // Forcing coefficient

     // lambdaBoundaryCoeff  10;  // Optional boundary forcing coefficient
                             // Useful when wave BCs are specified at outlets

        // Write the forcing fields: forcing:scale, forcing:forceCoeff
        writeForceFields true;
    }
    \endverbatim
2023-09-14 13:15:30 +01:00
269513a82f LESdeltas: Prandtl, smooth, vanDriest: Prevent infinite recursion on construction
These deltas constructs another sub-delta, using the same keyword (i.e.,
'delta') to select the type of the sub-delta as was used to select the
outer delta. For example:

    delta           vanDriest;

    vanDriestCoeffs
    {
        delta           cubeRootVol;
    }

The '<Type>Coeffs' sub-dictionary is now not optional. It cannot be
optional, because if it were omitted then the 'delta' entries would
clash. If the coefficients dictionary were omitted and (for example) the
'vanDriest' entry was chosen, then the constructors would get stuck in
an infinite recursion, with each vanDriest delta just constructing
another vanDriest sub-delta.
2023-09-12 11:47:50 +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
0eb3479f9b Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-09-08 15:11:19 +01:00
7b6b758dd8 waves::fvModels::forcing: Added option to write the forcing fields
e.g.

    waveForcing1
    {
        type            waveForcing;

        libs            ("libwaves.so");

        liquidPhase     water;

        // Define the line along which to apply the graduation
        origin          (600 0 0);
        direction       (-1 0 0);

        // // Or, define multiple lines
        // origins         ((600 0 0) (600 -300 0) (600 300 0));
        // directions      ((-1 0 0) (0 1 0) (0 -1 0));

        scale
        {
            type        halfCosineRamp;
            start       0;
            duration    300;
        }

        lambda          0.5; // Forcing coefficient

     // lambdaBoundary  2;   // Optional boundary forcing coefficient
                             // Useful when wave BCs are specified
                             // without mean flow

        // Write the forcing fields: forcing:scale, forcing:forceCoeff
        writeForceFields true;
    }

will write the fields forcing:scale and forcing:forceCoeff at the start of the
run to visualise and check correctness.
2023-09-08 15:09:56 +01:00
8811d390e7 CloudFunctionObjects: VolumeFraction: Register field
This means the field can be used by other run-time post-processing
functions; e.g., with '#includeFunc volIntegrate(cloud:alpha)'.
2023-09-08 09:10:02 +01:00
5e8748c6eb CloudFunctionObjects: ParticleErosion, PatchCollisionDensity: Execute before hitting the face
These functions cannot execute on the 'postPatch' hook because at this
point the particle properties have already been altered by the patch
interaction (i.e., the rebound has occurred and the velocity has
reversed). They need to execute in advance of the patch interaction.
There is no 'prePatch' hook, and implementing one is not
straightforward, so these functions have been changed to use the
'preFace' hook and manually check that the face in question is a
boundary face.

Patch contributed by Timo Niemi, VTT.
2023-09-07 14:52:11 +01:00
046c5b7d83 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2023-09-07 12:38:59 +01:00
78c9ffaaac constrainHbyA: Added constrainHbyA and constrainPhiHbyA which constrain the argument
used by the multiphaseEuler solver module.
2023-09-07 12:37:45 +01:00
8c2aef67d8 fvMeshStitcher: Resize the mesh flux on disconnect
This is now necessary that the mesh flux is not returned by
fvMesh::fields. It fixes an error generated by debug builds.
2023-09-07 10:05:47 +01:00
c0e1e1e039 lagrangian: InjectionModel: Clone autoPtr members in copy construct 2023-09-06 12:37:07 +01:00
31b096f63d CloudFunctionObjects/VolumeFraction: Replacement for VoidFraction
The volumeFraction cloud function will create and write a vol-field of
the cloud's volume fraction. It requires no additional controls. Example
in constant/cloudProperties:

    cloudFunctions
    {
        volumeFraction1
        {
            type volumeFraction;
        }
    }

This replaces voidFraction, which was incorrectly named in that it also
write the volume fraction (not one-minus the volume fraction), and who's
storage of the field was flawed in that it caused registration clashes
with fields stored by certain other Lagrangian models.
2023-09-06 12:37:07 +01:00