Commit Graph

13 Commits

Author SHA1 Message Date
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
8495fc9dc8 fvPatchField<Type>: Removed unused null-constructors 2023-05-28 08:40:08 +01:00
3d2cd9a3b2 fvModels, fvConstraints: Updated constructor argument order for consistency with functionObjects
Following the convention chosen for functionObjects the coefficients dictionary
argument is last in constructor argument list.
2023-01-28 10:28:29 +00:00
7592a81c6e polyMeshMap: New mesh to mesh map for the new mapping update function mapMesh(const polyMeshMap&)
This new mapping structure is designed to support run-time mesh-to-mesh mapping
to allow arbitrary changes to the mesh structure, for example during extreme
motion requiring significant topology change including region disconnection etc.
2022-04-04 11:15:41 +01:00
1aa194e18b Updated documentation for the distribute(const polyDistributionMap&) function 2022-04-01 09:11:09 +01:00
6047f27aac polyDistributionMap: renamed from polyMeshDistributionMap for consistency with polyTopoChangeMap 2022-03-31 23:44:47 +01:00
3ace8f434b polyTopoChangeMap: Renamed from mapPolyMesh to clarify purpose and scope
The polyTopoChangeMap is the map specifically relating to polyMesh topological
changes generated by polyTopoChange and used to update and map mesh related
types and fields following the topo-change.
2022-03-31 22:05:37 +01:00
2e6eb5f2ce polyMeshDistributionMap: renamed mapDistributePolyMesh -> polyMeshDistributionMap
This is a map data structure rather than a class or function which performs the
mapping operation so polyMeshDistributionMap is more logical and comprehensible
than mapDistributePolyMesh.
2022-03-31 18:01:44 +01:00
b3e785579a codedFvModelTemplate: Added distribute(const mapDistributePolyMesh&) for mesh redistribution 2022-01-04 23:48:36 +00:00
19bdfa969f fvModels, fvConstraints: Update as a result of mesh motion 2021-08-12 13:26:53 +01:00
252b71f3c6 fvModels: Simplified structure using fvCellSet member data
which will allow for a run-time selectable and hence extensible fvCellSet in the
future.
2021-03-09 15:17:32 +00:00
6e172a708d fvModels: codedSource -> codedFvModel 2021-03-08 14:53:22 +00:00
da3f4cc92e fvModels, fvConstraints: Rational separation of fvOptions between physical modelling and numerical constraints
The new fvModels is a general interface to optional physical models in the
finite volume framework, providing sources to the governing conservation
equations, thus ensuring consistency and conservation.  This structure is used
not only for simple sources and forces but also provides a general run-time
selection interface for more complex models such as radiation and film, in the
future this will be extended to Lagrangian, reaction, combustion etc.  For such
complex models the 'correct()' function is provided to update the state of these
models at the beginning of the PIMPLE loop.

fvModels are specified in the optional constant/fvModels dictionary and
backward-compatibility with fvOption is provided by reading the
constant/fvOptions or system/fvOptions dictionary if present.

The new fvConstraints is a general interface to optional numerical constraints
applied to the matrices of the governing equations after construction and/or to
the resulting field after solution.  This system allows arbitrary changes to
either the matrix or solution to ensure numerical or other constraints and hence
violates consistency with the governing equations and conservation but it often
useful to ensure numerical stability, particularly during the initial start-up
period of a run.  Complex manipulations can be achieved with fvConstraints, for
example 'meanVelocityForce' used to maintain a specified mean velocity in a
cyclic channel by manipulating the momentum matrix and the velocity solution.

fvConstraints are specified in the optional system/fvConstraints dictionary and
backward-compatibility with fvOption is provided by reading the
constant/fvOptions or system/fvOptions dictionary if present.

The separation of fvOptions into fvModels and fvConstraints provides a rational
and consistent separation between physical and numerical models which is easier
to understand and reason about, avoids the confusing issue of location of the
controlling dictionary file, improves maintainability and easier to extend to
handle current and future requirements for optional complex physical models and
numerical constraints.
2021-03-07 22:45:01 +00:00