Commit Graph

3346 Commits

Author SHA1 Message Date
5ed8dbb463 fvModels: Added support for mesh redistribution and load-balancing 2021-12-24 15:02:30 +00:00
4267bb6c37 fvConstraints: Added support for mesh redistribution and load-balancing 2021-12-24 11:32:06 +00:00
a4e02fb247 MeshObject: Added DistributeableMeshObject for mesh distribution and load-balancing
The new DistributeableMeshObject MeshObject provides the interface for the
distribute(const mapDistributePolyMesh&) function used to distribute mesh
related objects following redistribution.
2021-12-24 10:05:23 +00:00
ebfe26b2b3 TimeState: Removed temporary protected status of the private member data
This temporary change is no longer needed now that integration of user-time into
Time is complete.
2021-12-24 00:11:31 +00:00
74917f80cc Zoltan: Added configuration file for zoltanRenumber 2021-12-22 17:01:16 +00:00
526b3840c7 renumberMethods::zoltanRenumber: set default ORDER_METHOD to LOCAL_HSFC
also adding optional "libs" entry to renumberMeshDict so that the
libzoltanRenumber.so can be loaded at run-time rather than having to recompile
and relink the renumberMesh utility to support it.
2021-12-20 22:48:37 +00:00
7934ed693c surfaceFilmModels::surfaceFilm: Cache the fieldNames to simplify equation source selection 2021-12-17 15:13:09 +00:00
083b51e30d chemistryReduction: Restore default selection of no reduction if settings are absent 2021-12-17 09:21:29 +00:00
cc3b257ce3 LiquidEvaporation: Added condensation switch
This switch controls whether or not the model clips a droplet's outlet
mass flow rate to zero or permits it to become negative and thereby
represent condensation. By default condensation is not permitted.
2021-12-17 09:21:29 +00:00
145eb5392a surfaceFilmModels::kinematicSingleLayer: Added access function for the phaseName 2021-12-17 09:17:06 +00:00
ad20aecf0e surfaceFilmModel: film model selection now handled by fvModel
There is no longer any need for the surfaceFilmModel abstract base class and
"New" selection method as surface films are now handled within the fvModel
framework.  This makes the surfaceFilmModel entry in the surfaceFilmProperties
dictionary redundant.

The surfaceFilm and VoFSurfaceFilm fvModels now instantiate a thermoSingleLayer
providing direct access to all the film functions, simplifying the
implementation better ensuring consistency between the film and primary region
equations.
2021-12-16 20:51:08 +00:00
593befd959 chemistryReductionMethod: Reduce code duplication 2021-12-16 11:16:02 +00:00
4f0dfc3bdf chemistryModel: Change of state variable to mass fraction
The chemistry model now solves a system of mass fractions, temperature
and pressure, rather than a system of concentrations, temperature and
pressure.

The new form now accounts for the change in reaction rate associated
with thermal expansion. Thermal expansion (or contraction) can dilute
(or concentrate) the species concentrations, thereby reducing (or
increasing) the reaction rates. Previously it was not possible to
include this term because it was not computationally feasible to
evaluate it in a system in which the state variable was concentration.

The reaction rate interface has been simplified with respect to the
generation of derivatives. Reactions are defined as k*C, where k is the
reaction rate and C is the product of concentrations (raised to their
stoichiomentric coefficients and/or specified powers). Reaction rate
classes now provide two logical functions governing the derivatives of
k; i.e., ddT (derivative w.r.t. temperature) and ddc (derivative w.r.t.
concentration). Previously the reaction rate interface was closely
related to the form of third-body reactions, which made it inconvenient
to implement rates that were not very third-body-like.

It is now possible to verify the implementations of the jacobian methods
by comparison with finite-difference based evaluations of the rate
methods. This has been done and a number of bugs have been found and
fixed in the reaction rate classes.
2021-12-16 09:08:06 +00:00
2d7a576d6b thermophysicalModels: Added volumetric thermal expansion coefficient to equations of state
This is needed by chemistry to represent the effect of thermal expansion
as a result of reaction heat on the concentrations used to evalate the
reaction rates.
2021-12-16 09:07:28 +00:00
011397877b ISAT: Bug fixes
Fixed field size missmatch bug in binary tree rebalancing. Fixed issue
where CPU time was not accumulated for retrieve. Corrected retrieve so
that it extrapolates the entire output vector, including temperature and
pressure.
2021-12-16 09:05:53 +00:00
f97f6326f0 Decomposition/redistribution: Separated choice of mesh decomposition and redistribution methods
When snappyHexMesh is run in parallel it re-balances the mesh during refinement
and layer addition by redistribution which requires a decomposition method
that operates in parallel, e.g. hierachical or ptscotch.  decomposePar uses a
decomposition method which operates in serial e.g. hierachical but NOT
ptscotch.  In order to run decomposePar followed by snappyHexMesh in parallel it
has been necessary to change the method specified in decomposeParDict but now
this is avoided by separately specifying the decomposition and distribution
methods, e.g. in the incompressible/simpleFoam/motorBike case:

numberOfSubdomains  6;

decomposer      hierarchical;
distributor     ptscotch;

hierarchicalCoeffs
{
    n               (3 2 1);
    order           xyz;
}

The distributor entry is also used for run-time mesh redistribution, e.g. in the
multiphase/interFoam/RAS/floatingObject case re-distribution for load-balancing
is enabled in constant/dynamicMeshDict:

distributor
{
    type            distributor;

    libs            ("libfvMeshDistributors.so");

    redistributionInterval  10;
}

which uses the distributor specified in system/decomposeParDict:

distributor     hierarchical;

This rationalisation provides the structure for development of mesh
redistribution and load-balancing.
2021-12-15 22:12:00 +00:00
349addce38 decompositionMethod: Changed selection message output from Pout to Info 2021-12-15 11:47:35 +00:00
d90f421841 zoltanRenumber: Updated, corrected and tested 2021-12-15 11:45:11 +00:00
d9be4381f5 fvMeshDistribute: Allow the use of a non-empty patch instead of an internal patch when no fields require mapping 2021-12-10 16:51:35 +00:00
1151440be8 snappyHexMesh: Corrected handling of locationsInMesh with baffles 2021-12-10 16:50:54 +00:00
d8a56df156 vtkSetWriter: Support binary output
Resolves bug report https://bugs.openfoam.org/view.php?id=3763
2021-12-10 09:47:47 +00:00
b65f8a1e37 functionObjects, layerAverage: Permit layers that do not span the mesh 2021-12-09 21:08:03 +00:00
da18afe589 setAndNormalToFaceZone: Standardise input syntax
The set is now specified with a "set" keyword, as the fact that it is a
faceSet is clear from context. The old "faceSet" keyword is maintained
for backwards compatibility.
2021-12-09 21:08:03 +00:00
8bb0129936 solidBodyMotionFunctions::axisRotationMotion: Added special treatment for time = 0
to avoid division by 0 at the beginning of the run when no transformation is
applied.
2021-12-09 16:30:28 +00:00
029db2748b Time: Changed all the entries in <time>/uniform/time to user-time 2021-12-09 15:53:57 +00:00
bf5f056296 fvMeshDistributors: New library for mesh redistribution and load-balancing
Basic support is now provided for dynamic mesh redistribution, particularly for
load-balancing.  The mesh distributor is selected in the optional 'distributor'
entry in dynamicMeshDict, for example in the
multiphase/interFoam/RAS/floatingObject tutorial case when run in parallel using
the new Allrun-parallel script

distributor
{
    type            decomposer;

    libs            ("libfvMeshDistributors.so");

    redistributionInterval  10;
}

in which the 'decomposer' form of redistribution is selected to call the mesh
decomposition method specified in decomposeParDict to re-decompose the mesh for
redistribution.  The redistributionInterval entry specifies how frequently mesh
redistribution takes place, in the above every 10th time-step.  An optional
maxImbalance entry is also provided to control redistribution based on the cell
distribution imbalance:

Class
    Foam::fvMeshDistributor::decomposer

Description
    Dynamic mesh redistribution using the decomposer

Usage
    Example of single field based refinement in all cells:
    \verbatim
    distributor
    {
        type            decomposer;

        libs            ("libfvMeshDistributors.so");

        // How often to redistribute
        redistributionInterval  10;

        // Maximum fractional cell distribution imbalance
        // before rebalancing
        maxImbalance    0.1;
    }
    \endverbatim

Currently mesh refinement/unrefinement and motion with redistribution is
supported but many aspects of OpenFOAM are not yet and will require further
development, in particular fvModels and Lagrangian.

Also only the geometry-based simple and hierarchical decomposition method are
well behaved for redistribution, scotch and ptScotch cause dramatic changes in
mesh distribution with a corresponding heavy communications overhead limiting
their usefulness or at least the frequency with which they should be called to
redistribute the mesh.
2021-12-09 14:06:45 +00:00
053eed714d functionObjects: layerAverage: Replacment for postChannel
This function generates plots of fields averaged over the layers in the
mesh. It is a generalised replacement for the postChannel utility, which
has been removed. An example of this function's usage is as follows:

    layerAverage1
    {
        type            layerAverage;
        libs            ("libfieldFunctionObjects.so");

        writeControl    writeTime;

        setFormat       raw;

        // Patches and/or zones from which layers extrude
        patches         (bottom);
        zones           (quarterPlane threeQuartersPlane);

        // Spatial component against which to plot
        component       y;

        // Is the geometry symmetric around the centre layer?
        symmetric       true;

        // Fields to average and plot
        fields          (pMean pPrime2Mean UMean UPrime2Mean k);
    }
2021-12-08 12:48:54 +00:00
31fee136e1 fvMotionSolvers: Reinstated velocity and componentVelocity motion solvers
There are cases still using these deprecated motion solvers pending update to
use interpolated displacement motion methods.
2021-12-08 11:48:40 +00:00
5c4d42224f entrainmentPressureFvPatchScalarField: Apply fixed pressure to outflow
Pressure reduction is now applied only for entrained flow, fixed pressure is
applied to outflow to improve stability for complex recirculating flow exiting
the domain.  This is the same approach used in the totalPressure boundary
condition.
2021-12-08 10:37:25 +00:00
25b60616ac fvMeshMovers::valveBank.H: Removed unused code
Resolves bug-report https://bugs.openfoam.org/view.php?id=3760
2021-12-07 17:17:00 +00:00
5d93da3aed snappyHexMesh: Added castellatedMeshControls:extendedRefinementSpan option
The code relating to extending refinement to the span of the facet/triangles
intersected by the refinement distance referred to in report

https://bugs.openfoam.org/view.php?id=3361

and temporarily removed may now be selected by the optional
castellatedMeshControls:extendedRefinementSpan entry in snappyHexMeshDict.  It
in not clear if this control is generally beneficial and very few users have
reported a preference and too few example cases have been provided to make a
balanced judgement so it has been decided to reinstate the previous default
behaviour and default extendedRefinementSpan to true.
2021-12-07 12:17:52 +00:00
7f6e3bf4cb rawSurfaceWriter: Indicate point or face data in the header 2021-12-07 11:29:37 +00:00
25a6d068f0 sampledSets, streamlines: Various improvements
Sampled sets and streamlines now write all their fields to the same
file. This prevents excessive duplication of the geometry and makes
post-processing tasks more convenient.

"axis" entries are now optional in sampled sets and streamlines. When
omitted, a default entry will be used, which is chosen appropriately for
the coordinate set and the write format. Some combinations are not
supported. For example, a scalar ("x", "y", "z" or "distance") axis
cannot be used to write in the vtk format, as vtk requires 3D locations
with which to associate data. Similarly, a point ("xyz") axis cannot be
used with the gnuplot format, as gnuplot needs a single scalar to
associate with the x-axis.

Streamlines can now write out fields of any type, not just scalars and
vectors, and there is no longer a strict requirement for velocity to be
one of the fields.

Streamlines now output to postProcessing/<functionName>/time/<file> in
the same way as other functions. The additional "sets" subdirectory has
been removed.

The raw set writer now aligns columns correctly.

The handling of segments in coordSet and sampledSet has been
fixed/completed. Segments mean that a coordinate set can represent a
number of contiguous lines, disconnected points, or some combination
thereof. This works in parallel; segments remain contiguous across
processor boundaries. Set writers now only need one write method, as the
previous "writeTracks" functionality is now handled by streamlines
providing the writer with the appropriate segment structure.

Coordinate sets and set writers now have a convenient programmatic
interface. To write a graph of A and B against some coordinate X, in
gnuplot format, we can call the following:

    setWriter::New("gnuplot")->write
    (
        directoryName,
        graphName,
        coordSet(true, "X", X), // <-- "true" indicates a contiguous
        "A",                    //     line, "false" would mean
        A,                      //     disconnected points
        "B",
        B
    );

This write function is variadic. It supports any number of
field-name-field pairs, and they can be of any primitive type.

Support for Jplot and Xmgrace formats has been removed. Raw, CSV,
Gnuplot, VTK and Ensight formats are all still available.

The old "graph" functionality has been removed from the code, with the
exception of the randomProcesses library and associated applications
(noise, DNSFoam and boxTurb). The intention is that these should also
eventually be converted to use the setWriters. For now, so that it is
clear that the "graph" functionality is not to be used elsewhere, it has
been moved into a subdirectory of the randomProcesses library.
2021-12-07 11:18:27 +00:00
a0ac78c129 MeshObject: Added distribute(const mapDistributePolyMesh&) for mesh-motion
To support mesh redistribution for load-balancing etc. all MeshObjects requiring
a special updateMesh(const mapPolyMesh&) function will also require a
distribute(const mapDistributePolyMesh&) to handle the redistribution of
no-field and unregistered mesh-related state data.

Fortunately there are not many MeshObjects requiring a special distribute(const
mapDistributePolyMesh&) implementation but it will take some time to implement
and test all those that do; this patch provides those for displacement-based
mesh-movers.
2021-12-06 12:27:59 +00:00
02a40ce77b transonicEntrainmentPressureFvPatchScalarField: Apply a fixed total-pressure condition for outflow 2021-12-06 11:33:48 +00:00
7d4dcacbd4 functionObjects::wallHeatFlux: Added phase support
wallHeatFlux can now be used to calculate the phase wall heat-flux in
multiphase systems, e.g.

    multiphaseEulerFoam -postProcess -func 'wallHeatFlux(phase=water)' -latestTime
2021-12-03 16:45:46 +00:00
e6acc7d991 functionObjects::wallShearStress: Added phase support
wallShearStress can now be used to calculate the phase wall shear-stress in
multiphase systems, e.g.

    multiphaseEulerFoam -postProcess -func 'wallShearStress(phase=water)' -latestTime
2021-12-03 16:28:40 +00:00
d10f229c4d transonicEntrainmentPressureFvPatchScalarField: New entrainment pressure boundary condition supporting supersonic jets
Description
    This boundary condition provides an entrainment condition for pressure
    including support for supersonic jets exiting the domain.

Usage
    \table
        Property     | Description                 | Required | Default value
        rho          | Density field name          | no       | rho
        psi          | Compressibility field name  | no       | thermo:psi
        gamma        | Heat capacity ratio (cp/Cv) | yes      |
        phi          | Flux field name             | no       | phi
        p0           | Reference pressure          | yes      |
    \endtable

    Example of the boundary condition specification:
    \verbatim
    <patchName>
    {
        type            transonicEntrainmentPressure;
        gamma           1.4;
        p0              uniform 1e5;
    }
    \endverbatim

See also
    Foam::entrainmentPressureFvPatchScalarField
    Foam::mixedFvPatchField
2021-12-03 14:57:22 +00:00
85e548df23 entrainmentPressureFvPatchScalarField: Added support for mass-flux -> velocity conversion
so that the entrainmentPressure BC can be applied to compressible and multiphase
cases.
2021-12-03 14:47:56 +00:00
ce000453d7 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2021-11-25 16:11:25 +00:00
26f0e47d4b AndradeTransport: New specie transport model for liquids
Description
    Transport package using the Andrade function for the natural logarithm of
    dynamic viscosity and thermal conductivity of liquids:

    \verbatim
        log(mu) = muCoeffs[0] + muCoeffs[1]*T + muCoeffs[2]*sqr(T)
          + muCoeffs_[3]/(muCoeffs_[4] + T)

        log(kappa) = kappaCoeffs[0] + kappaCoeffs[1]*T + kappaCoeffs[2]*sqr(T)
          + kappaCoeffs_[3]/(kappaCoeffs_[4] + T)
    );
    \endverbatim

    References:
    \verbatim
        Andrade, E. D. C. (1934).
        XLI. A theory of the viscosity of liquids.—Part I.
        The London, Edinburgh, and Dublin Philosophical Magazine
        and Journal of Science, 17(112), 497-511.

        Andrade, E. D. C. (1934).
        LVIII. A theory of the viscosity of liquids.—Part II.
        The London, Edinburgh, and Dublin Philosophical Magazine
        and Journal of Science, 17(113), 698-732.
    \endverbatim

Usage
    \table
        Property        | Description
        muCoeffs        | Dynamic viscosity polynomial coefficients
        kappaCoeffs     | Thermal conductivity polynomial coefficients
    \endtable

    Example of the specification of the transport properties for water@200bar:
    \verbatim
    transport
    {
        muCoeffs    (-25.8542 0.031256 -2.2e-05 3289.918 -11.4784);
        kappaCoeffs (-2.56543 0.008794 -9.8e-06 100.368 0);
    }
    \endverbatim
2021-11-25 16:10:07 +00:00
506d2891b7 transformerIOList: Centralised instantiation 2021-11-25 09:45:04 +00:00
068ed634d2 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2021-11-24 14:54:11 +00:00
e931ccada1 ThermophysicalTransportModels::MaxwellStefan::j(): Added support for the default specie
Resolves bug-report https://bugs.openfoam.org/view.php?id=3755
2021-11-24 14:53:12 +00:00
75cf502d34 streamlinesParticle: Instantiate transformer IO list 2021-11-24 12:37:10 +00:00
701fc2b6a5 streamlines: Corrected handling of cyclic boundaries
By default a streamline now stops at the cyclic and starts again at the
coupled location on the opposite cyclic.

There is also now an "outside" option that can be passed to the
streamlines function. This changes the default behaviour so that the
streamline continues outside of the mesh when it encounters a cyclic
patch. The following postProcess command uses the "outside" option in
this way:

    postProcess -latestTime -func "
        streamlinesPatch
        (
            patch=inlet,
            nPoints=50,
            outside=true,
            fields=(p U)
        )"
2021-11-24 12:26:12 +00:00
261ce05fac sampledSurfaces: Write multiple fields to the same file
This prevents excessive duplication of surface geometry and makes
post-processing tasks in paraview more convenient.

The Nastran and Star-CD surface formats were found not to work, so
support for these output types has been removed. Raw, VTK, Foam and
Ensight formats are all still available.
2021-11-23 14:44:34 +00:00
687996724a fvMeshDistributors: New framework within fvMesh to handle run-time mesh redistribution
for e.g. load-balancing.  The fvMeshDistributor is selected via the new optional
distributor entry in dynamicMeshDict, e.g.

distributor
{
    type            decomposer;

    libs            ("libfvMeshDistributors.so");
}

Note that currently only the framework is included in this commit, the
fvMeshDistributors library is not yet fully functional and hence not released
yet.
2021-11-18 15:10:15 +00:00
a1622077e2 fvConstraints::limitPressure: Added support for maxFactor and minFactor when p has calculated BCs
When limiting the pressure in p_rgh based solvers p typically has calculated BCs
which are now supported when calculating the max and min pressure from maxFactor
and minFactor.
2021-11-18 14:49:41 +00:00
4b5491300f sampledSurfaces: Fixed failure to write surfaces 2021-11-18 09:49:51 +00:00