Commit Graph

17692 Commits

Author SHA1 Message Date
c393b268a5 MULES: Adjust limiter only at boundaries for which the field value is fixed
Resolves bug-report https://bugs.openfoam.org/view.php?id=2470
2017-02-23 12:03:50 +00:00
e5cc374d8e MULES: Adjust limiter only at boundaries for which the field value is fixed
Resolves bug-report https://bugs.openfoam.org/view.php?id=2470
2017-02-22 15:34:13 +00:00
12dd3c9c6b GeometricField: corrected assignment to tmp which wraps a non-tmp 2017-02-22 13:20:49 +00:00
5991e30fc1 functionObjects::fieldCoordinateSystemTransform: added coordinateSystem sub-dict and updated the description
Patch contributed by Bruno Santos
Resolves bug-report https://bugs.openfoam.org/view.php?id=2454
2017-02-22 13:20:15 +00:00
bec7091e21 chemkinToFoam: Increase the precision of the thermophysical coefficient written 2017-02-21 11:59:49 +00:00
a06cd912d8 solidMixtureProperties: Updated documentation, removed unused functions and corrected remaining 2017-02-20 15:30:25 +00:00
e5ecc28891 liquidMixtureProperties: Updated documentation 2017-02-20 15:30:07 +00:00
f6dacfb484 liquidThermo: rhoThermo instantiated on liquidProperties
This allows single, multi-phase and VoF compressible simulations to be performed
with the accurate thermophysical property functions for liquids provided by the
liquidProperty classes.  e.g. in the
multiphase/compressibleInterFoam/laminar/depthCharge2D tutorial water can now be
specified by

thermoType
{
    type            heRhoThermo;
    mixture         pureMixture;
    properties      liquid;
    energy          sensibleInternalEnergy;
}

mixture
{
    H2O;
}

as an alternative to the previous less accurate representation defined by

thermoType
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectFluid;
    specie          specie;
    energy          sensibleInternalEnergy;
}

mixture
{
    specie
    {
        molWeight   18.0;
    }
    equationOfState
    {
        R           3000;
        rho0        1027;
    }
    thermodynamics
    {
        Cp          4195;
        Hf          0;
    }
    transport
    {
        mu          3.645e-4;
        Pr          2.289;
    }
}

However the increase in accuracy of the new simpler and more convenient
specification and representation comes at a cost: the NSRDS functions used by
the liquidProperties classes are relatively expensive to evaluate and the
depthCharge2D case takes ~14% longer to run.
2017-02-19 16:44:00 +00:00
d2be645483 thermophysicalProperties: New base-class for liquidProperties and in the future gasProperties
Description
    Base-class for thermophysical properties of solids, liquids and gases
    providing an interface compatible with the templated thermodynamics
    packages.

liquidProperties, solidProperties and thermophysicalFunction libraries have been
combined with the new thermophysicalProperties class into a single
thermophysicalProperties library to simplify compilation and linkage of models,
libraries and applications dependent on these classes.
2017-02-18 21:53:20 +00:00
de44d09ad9 liquidProperties, solidProperties: Simplified input
The entries for liquid and solid species can now be simply be the name unless
property coefficients are overridden in which are specified in a dictionary as
before e.g. in the tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek case
the water is simply specified

liquids
{
    H2O;
}

and solid ash uses standard coefficients but the coefficients for carbon are
overridden thus

solids
{
    C
    {
        rho             2010;
        Cp              710;
        kappa           0.04;
        Hf              0;
        emissivity      1.0;
    }

    ash;
}
2017-02-18 12:43:10 +00:00
9b4f327e2b liquidProperties: Simplified dictionary format
The defaultCoeffs entry is now redundant and supported only for backward
compatibility.  To specify a liquid with default coefficients simply leave the
coefficients dictionary empty:

    liquids
    {
        H2O {}
    }

Any or all of the coefficients may be overridden by specifying the properties in
the coefficients dictionary, e.g.

    liquids
    {
        H2O
        {
            rho
            {
                a 1000;
                b 0;
                c 0;
                d 0;
            }
        }
    }
2017-02-17 22:08:42 +00:00
a6fd99b874 liquidProperties: simplified and generalized the IO
When liquids are constructed from dictionary the coefficients are now first
initialized to their standard values and overridden by the now optional entries
provided in the dictionary.  For example to specify water with all the standard
temperature varying properties but override only the density with a constant
value of 1000 specify in thermophysicalProperties

liquids
{
    H2O
    {
        defaultCoeffs   no;

        H2OCoeffs
        {
            rho
            {
                a 1000;
                b 0;
                c 0;
                d 0;
            }
        }
    }
}
2017-02-17 20:29:58 +00:00
ba9d58a26f thermophysicalModels: Ostream operator calls write(os) for consistent IO 2017-02-17 16:35:43 +00:00
72b705edbd thermophysicalModels: Removed unused and unmaintained Istream constructors 2017-02-17 15:50:00 +00:00
3e4d253cc1 liquidProperties: Removed unused construction from Istream 2017-02-17 13:41:05 +00:00
c52e4b58a1 thermophysicalModels: Changed specie thermodynamics from mole to mass basis
The fundamental properties provided by the specie class hierarchy were
mole-based, i.e. provide the properties per mole whereas the fundamental
properties provided by the liquidProperties and solidProperties classes are
mass-based, i.e. per unit mass.  This inconsistency made it impossible to
instantiate the thermodynamics packages (rhoThermo, psiThermo) used by the FV
transport solvers on liquidProperties.  In order to combine VoF with film and/or
Lagrangian models it is essential that the physical propertied of the three
representations of the liquid are consistent which means that it is necessary to
instantiate the thermodynamics packages on liquidProperties.  This requires
either liquidProperties to be rewritten mole-based or the specie classes to be
rewritten mass-based.  Given that most of OpenFOAM solvers operate
mass-based (solve for mass-fractions and provide mass-fractions to sub-models it
is more consistent and efficient if the low-level thermodynamics is also
mass-based.

This commit includes all of the changes necessary for all of the thermodynamics
in OpenFOAM to operate mass-based and supports the instantiation of
thermodynamics packages on liquidProperties.

Note that most users, developers and contributors to OpenFOAM will not notice
any difference in the operation of the code except that the confusing

    nMoles     1;

entries in the thermophysicalProperties files are no longer needed or used and
have been removed in this commet.  The only substantial change to the internals
is that species thermodynamics are now "mixed" with mass rather than mole
fractions.  This is more convenient except for defining reaction equilibrium
thermodynamics for which the molar rather than mass composition is usually know.
The consequence of this can be seen in the adiabaticFlameT, equilibriumCO and
equilibriumFlameT utilities in which the species thermodynamics are
pre-multiplied by their molecular mass to effectively convert them to mole-basis
to simplify the definition of the reaction equilibrium thermodynamics, e.g. in
equilibriumCO

    // Reactants (mole-based)
    thermo FUEL(thermoData.subDict(fuelName)); FUEL *= FUEL.W();

    // Oxidant (mole-based)
    thermo O2(thermoData.subDict("O2")); O2 *= O2.W();
    thermo N2(thermoData.subDict("N2")); N2 *= N2.W();

    // Intermediates (mole-based)
    thermo H2(thermoData.subDict("H2")); H2 *= H2.W();

    // Products (mole-based)
    thermo CO2(thermoData.subDict("CO2")); CO2 *= CO2.W();
    thermo H2O(thermoData.subDict("H2O")); H2O *= H2O.W();
    thermo CO(thermoData.subDict("CO")); CO *= CO.W();

    // Product dissociation reactions

    thermo CO2BreakUp
    (
        CO2 == CO + 0.5*O2
    );

    thermo H2OBreakUp
    (
        H2O == H2 + 0.5*O2
    );

Please report any problems with this substantial but necessary rewrite of the
thermodynamic at https://bugs.openfoam.org

Henry G. Weller
CFD Direct Ltd.
2017-02-17 11:22:14 +00:00
2f5185a048 functionObjects::scalarTransport: Corrected typo 2017-02-13 18:25:33 +00:00
ae9522f017 functionObjects::scalarTransport: Added support for optional laminar and turbulent diffusion coefficients
Description
    Evolves a passive scalar transport equation.

    - To specify the field name set the \c field entry
    - To employ the same numerical schemes as another field set
      the \c schemesField entry,
    - A constant diffusivity may be specified with the \c D entry,

    - Alternatively if a turbulence model is available a turbulent diffusivity
      may be constructed from the laminar and turbulent viscosities using the
      optional diffusivity coefficients \c alphaD and \c alphaDt (which default
      to 1):
      \verbatim
          D = alphaD*nu + alphaDt*nut
      \endverbatim

Resolves feature request https://bugs.openfoam.org/view.php?id=2453
2017-02-12 17:19:27 +00:00
dd8b8bceac csvSetWriter: Corrected axis header
Resolves bug-report https://bugs.openfoam.org/view.php?id=2455
2017-02-09 17:47:56 +00:00
b167c95f19 compressibleInterFoam: Completed LTS and semi-implicit MULES support
Now the interFoam and compressibleInterFoam families of solvers use the same
alphaEqn formulation and supporting all of the MULES options without
code-duplication.

The semi-implicit MULES support allows running with significantly larger
time-steps but this does reduce the interface sharpness.
2017-02-09 17:31:57 +00:00
6fc2a3dc58 compressibleInterFoam: More consistent with interFoam and added partial support for LTS 2017-02-08 20:50:07 +00:00
ba4eefae1d interFoam, interDyMFoam: Removed duplicate include 2017-02-08 20:47:59 +00:00
3879cf48fb interMixingFoam: Renamed alphaEqns.H and alphaEqnsSubCycle.H for consistency with interFoam 2017-02-08 20:46:31 +00:00
9d85d34f3a functionObjects::scalarTransport: Corrected FatalError 2017-02-08 16:57:30 +00:00
160efd89a6 porosityModels::solidification: Added optional phase-fraction for VoF solvers etc.
Description
    Simple solidification porosity model

    This is a simple approximation to solidification where the solid phase
    is represented as a porous blockage with the drag-coefficient evaluated from

        \f[
            S = - \alpha \rho D(T) U
        \f]

    where
    \vartable
        \alpha  | Optional phase-fraction of solidifying phase
        D(T)    | User-defined drag-coefficient as function of temperature
    \endvartable

    Note that the latent heat of solidification is not included and the
    temperature is unchanged by the modelled change of phase.

    Example of the solidification model specification:
    \verbatim
        type            solidification;

        solidificationCoeffs
        {
            // Solidify between 330K and 330.5K
            D table
            (
                (330.0     10000) // Solid below 330K
                (330.5     0)     // Liquid above 330.5K
            );

            // Optional phase-fraction of solidifying phase
            alpha alpha.liquid;

            // Solidification porosity is isotropic
            // use the global coordinate system
            coordinateSystem
            {
                type    cartesian;
                origin  (0 0 0);
                coordinateRotation
                {
                    type    axesRotation;
                    e1      (1 0 0);
                    e2      (0 1 0);
                }
            }
        }
    \endverbatim
2017-02-08 10:40:14 +00:00
974624766f porosityModels::solidification: New porosity model to simulate solidification
Description
    Simple solidification porosity model

    This is a simple approximation to solidification where the solid phase
    is represented as a porous blockage with the drag-coefficient evaluated from

        \f[
            S = - \rho D(T) U
        \f]

    where
    \vartable
        D(T) | User-defined drag-coefficient as function of temperature
    \endvartable

    Note that the latent heat of solidification is not included and the
    temperature is unchanged by the modelled change of phase.

    Example of the solidification model specification:
    \verbatim
        type            solidification;

        solidificationCoeffs
        {
            // Solidify between 330K and 330.5K
            D table
            (
                (330.0     10000) // Solid below 330K
                (330.5     0)     // Liquid above 330.5K
            );

            // Solidification porosity is isotropic
            // use the global coordinate system
            coordinateSystem
            {
                type    cartesian;
                origin  (0 0 0);
                coordinateRotation
                {
                    type    axesRotation;
                    e1      (1 0 0);
                    e2      (0 1 0);
                }
            }
        }
    \endverbatim
2017-02-07 19:02:30 +00:00
c5e7f356c9 porosityModel::powerLaw: Added groupName to rho lookup to support multiphase 2017-02-07 19:01:34 +00:00
5f25843392 porosityModels: Corrected documentation 2017-02-07 19:00:58 +00:00
29e83f3958 compressibleInterFoam: Added support for fvOptions in both the U and T equations 2017-02-07 18:59:40 +00:00
8264c3b988 interDyMFoam: Reinstate alphaPhiCorr0 for moving meshes without topology change 2017-02-07 09:59:19 +00:00
ddf1268e73 functionObjects:surfaceFieldValue, volFieldValue: Added weightedSum and weighted[Area|Vol]Integrate
Patch contributed by Timo Niemi, VTT.
Resolves patch request https://bugs.openfoam.org/view.php?id=2452
2017-02-06 15:48:11 +00:00
23809f7ae7 PBiCG: Suggest changing to the more robust PBiCGStab solver
if convergence is not achieved within the maximum number of iterations.

Sometimes, particularly running in parallel, PBiCG fails to converge or diverges
without warning or obvious cause leaving a solution field containing significant
errors which can cause divergence of the application.  PBiCGStab is more robust
and does not suffer from the problems encountered with PBiCG.
2017-02-03 18:36:40 +00:00
7a7fa4350d Time: when "writeFormat" is set to "binary" disallow compression
Compressing and decompressing binary files introduces a significant IO overhead
without a providing significant reduction in file-size.
2017-02-03 14:51:04 +00:00
7612b51828 lagrangian::NonInertialFrameForce: Use field references rather than copies
Patch contributed by Mattijs Janssens
2017-02-03 14:29:07 +00:00
78ee6c2abb Time: When increasing precision check if the time name is unchanged
Patch contributed by Mattijs Janssens
2017-02-03 14:27:38 +00:00
83787036a9 functionObjects::streamLine: Reinstated default "U" 2017-02-03 14:25:02 +00:00
74f38251f8 kOmegaSSTSato: removed debug message 2017-02-03 11:37:56 +00:00
93fbd41785 kOmegaSSTBase: make correctNut(S2, F2) virtual
kOmegaSSTSato: Change correctNut() to correctNut(S2, F2)

Resolves bug-report https://bugs.openfoam.org/view.php?id=2450
2017-02-03 10:52:35 +00:00
ba4dbeda77 NamedEnum: Updated to support C++11 scoped enumerations 2017-02-02 17:02:59 +00:00
3d315f09f9 alphatWallBoilingWallFunctionFvPatchScalarField: Resolve restart issue
Patch contributed by Juho Peltola, VTT
Resolves patch request https://bugs.openfoam.org/view.php?id=2446
2017-01-30 16:39:36 +00:00
d951f7aaaf movingConeTopoFvMesh: M_PI -> Foam::constant::mathematical::pi 2017-01-30 16:38:58 +00:00
9812d957c9 ThermalPhaseChangePhaseSystem: Improved robustness
Patch contributed by Juho Peltola, VTT.
Resolves patch request https://bugs.openfoam.org/view.php?id=2443
2017-01-30 16:37:27 +00:00
70ac064f21 codedFunctionObject: Updated documentation
Patch contributed by Bruno Santos
Resolves bug-report https://bugs.openfoam.org/view.php?id=2441
2017-01-28 18:01:11 +00:00
1d211874aa functionObjects::streamLine,wallBoundedStreamLine: Removed outdated check for 'UName'
Patch contributed by Bruno Santos
Resolves patch request https://bugs.openfoam.org/view.php?id=2444
2017-01-28 17:59:34 +00:00
f92862a42c Allwmake: Provides clearer message when OpenFOAM environment is not loaded
Patch contributed by Bruno Santos
Resolves patch request https://bugs.openfoam.org/view.php?id=2424
2017-01-28 17:57:13 +00:00
7a2eb63824 Corrected spelling mistake 2017-01-26 20:18:50 +00:00
d4aba02652 combustionModels: Minor cleanup 2017-01-26 17:48:31 +00:00
5dd24f4968 Removed unhelpful clutter 2017-01-26 17:47:24 +00:00
1c1a69cabc patchInjectionBase: Improved particle positioning
Patch contributed by Timo Niemi, VTT.
Resolves bug-report https://bugs.openfoam.org/view.php?id=2442
2017-01-26 15:34:51 +00:00
8f7228d6f3 interDyMFoam: delete alphaPhiCorr0 if the mesh changes
The previous time-step compression flux is not valid/accurate on the new mesh
and it is better to re-calculate it rather than map it from the previous mesh to
the new mesh.
2017-01-25 11:54:12 +00:00