Commit Graph

344 Commits

Author SHA1 Message Date
Henry Weller
47d7240412 turbulenceModels::RAS: Corrected sign of "C3" dilatation term
Set default value of C3 to 0
Set C3 to -0.33 in the engineFoam/kivaTest tutorial.

Resolves bug-report https://bugs.openfoam.org/view.php?id=2496
2017-03-13 18:01:39 +00:00
Henry Weller
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
Henry Weller
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
Henry Weller
1e36c99588 PaSR: Removed deprecated "turbulentReaction" switch
To run with laminar reaction rates choose the "laminar" combustion model rather
than setting "turbulentReaction no;" in the "PaSR" model.
2017-01-20 17:17:14 +00:00
Henry Weller
1abec0652d tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D_GRI_TDAC: Added deltaT to TDAC controls 2017-01-17 22:41:30 +00:00
Henry Weller
47bd8e13f7 TDACChemistryModel: simplified, rationalized and automated the handling of variableTimeStep 2017-01-09 21:40:39 +00:00
Henry Weller
7e22440dc5 TDACChemistryModel: Added support for variable time-step and LTS in ISAT
New reactingFoam tutorial counterFlowFlame2DLTS_GRI_TDAC demonstrates this new
functionality.

Additionally the ISAT table growth algorithm has been further optimized
providing an overall speedup of between 15% and 38% for the tests run so far.

Updates to TDAC and ISAT provided by Francesco Contino.

Implementation updated and integrated into OpenFOAM-dev by
Henry G. Weller, CFD Direct Ltd with the help of Francesco Contino.

Original code providing all algorithms for chemistry reduction and
tabulation contributed by Francesco Contino, Tommaso Lucchini, Gianluca
D’Errico, Hervé Jeanmart, Nicolas Bourgeois and Stéphane Backaert.
2017-01-07 16:29:15 +00:00
Henry Weller
1e94682f24 tutorials: Renamed sub-directories ras -> RAS and les -> LES 2016-09-20 19:03:40 +01:00
Henry Weller
86ccbca390 combustionModels/FSD: Corrected
Renamed 'omega' to 'FSDomega' to avoid a clash with the k-omega
turbulence models.

Resolves bug-report http://bugs.openfoam.org/view.php?id=2237
2016-09-09 16:23:28 +01:00
Henry Weller
0857f479a8 PBiCGStab: New preconditioned bi-conjugate gradient stabilized solver for asymmetric lduMatrices
using a run-time selectable preconditioner

References:
    Van der Vorst, H. A. (1992).
    Bi-CGSTAB: A fast and smoothly converging variant of Bi-CG
    for the solution of nonsymmetric linear systems.
    SIAM Journal on scientific and Statistical Computing, 13(2), 631-644.

    Barrett, R., Berry, M. W., Chan, T. F., Demmel, J., Donato, J.,
    Dongarra, J., Eijkhout, V., Pozo, R., Romine, C. & Van der Vorst, H.
    (1994).
    Templates for the solution of linear systems:
    building blocks for iterative methods
    (Vol. 43). Siam.

See also: https://en.wikipedia.org/wiki/Biconjugate_gradient_stabilized_method

Tests have shown that PBiCGStab with the DILU preconditioner is more
robust, reliable and shows faster convergence (~2x) than PBiCG with
DILU, in particular in parallel where PBiCG occasionally diverges.

This remarkable improvement over PBiCG prompted the update of all
tutorial cases currently using PBiCG to use PBiCGStab instead.  If any
issues arise with this update please report on Mantis: http://bugs.openfoam.org
2016-09-05 11:46:42 +01:00
Henry Weller
428b1d8866 Updated headers 2016-08-24 08:57:44 +01:00
Henry Weller
30e456a641 fvDOM radiation model: Removed unreliable 'cacheDiv' option
Resolves bug-report http://bugs.openfoam.org/view.php?id=2182
2016-08-17 17:12:20 +01:00
Henry Weller
2e1557a79e tutorials Allrun scripts: Update running of postProcess application
Patch contributed by Bruno Santos
Resolves bug-report http://bugs.openfoam.org/view.php?id=2173
2016-08-02 16:24:28 +01:00
Henry Weller
1d57269680 TDACChemistryModel: New chemistry model providing Tabulation of Dynamic Adaptive Chemistry
Provides efficient integration of complex laminar reaction chemistry,
combining the advantages of automatic dynamic specie and reaction
reduction with ISAT (in situ adaptive tabulation).  The advantages grow
as the complexity of the chemistry increases.

References:
    Contino, F., Jeanmart, H., Lucchini, T., & D’Errico, G. (2011).
    Coupling of in situ adaptive tabulation and dynamic adaptive chemistry:
    An effective method for solving combustion in engine simulations.
    Proceedings of the Combustion Institute, 33(2), 3057-3064.

    Contino, F., Lucchini, T., D'Errico, G., Duynslaegher, C.,
    Dias, V., & Jeanmart, H. (2012).
    Simulations of advanced combustion modes using detailed chemistry
    combined with tabulation and mechanism reduction techniques.
    SAE International Journal of Engines,
    5(2012-01-0145), 185-196.

    Contino, F., Foucher, F., Dagaut, P., Lucchini, T., D’Errico, G., &
    Mounaïm-Rousselle, C. (2013).
    Experimental and numerical analysis of nitric oxide effect on the
    ignition of iso-octane in a single cylinder HCCI engine.
    Combustion and Flame, 160(8), 1476-1483.

    Contino, F., Masurier, J. B., Foucher, F., Lucchini, T., D’Errico, G., &
    Dagaut, P. (2014).
    CFD simulations using the TDAC method to model iso-octane combustion
    for a large range of ozone seeding and temperature conditions
    in a single cylinder HCCI engine.
    Fuel, 137, 179-184.

Two tutorial cases are currently provided:
    + tutorials/combustion/chemFoam/ic8h18_TDAC
    + tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D_GRI_TDAC

the first of which clearly demonstrates the advantage of dynamic
adaptive chemistry providing ~10x speedup,

the second demonstrates ISAT on the modest complex GRI mechanisms for
methane combustion, providing a speedup of ~4x.

More tutorials demonstrating TDAC on more complex mechanisms and cases
will be provided soon in addition to documentation for the operation and
settings of TDAC.  Also further updates to the TDAC code to improve
consistency and integration with the rest of OpenFOAM and further
optimize operation can be expected.

Original code providing all algorithms for chemistry reduction and
tabulation contributed by Francesco Contino, Tommaso Lucchini, Gianluca
D’Errico, Hervé Jeanmart, Nicolas Bourgeois and Stéphane Backaert.

Implementation updated, optimized and integrated into OpenFOAM-dev by
Henry G. Weller, CFD Direct Ltd with the help of Francesco Contino.
2016-07-17 15:13:54 +01:00
Henry Weller
b00e67ca37 foamChemistryReader: Added support for elements and specie composition
Based on a patch contributed by Francesco Contino, Tommaso Lucchini,
Gianluca D’Errico, Hervé Jeanmart, Nicolas Bourgeois and Stéphane
Backaert.
2016-07-12 09:05:00 +01:00
Henry Weller
6d330d3d12 tutorials: Updated formatting of dictionaries and specification of 'plane' and 'samplePlane' 2016-06-29 18:02:57 +01:00
Henry Weller
64aa9925e4 totalPressureFvPatchScalarField, uniformTotalPressureFvPatchScalarField: simplified and rationalized
The modes of operation are set by the dimensions of the pressure field
    to which this boundary condition is applied, the \c psi entry and the value
    of \c gamma:
    \table
        Mode                    | dimensions | psi   | gamma
        incompressible subsonic | p/rho      |       |
        compressible subsonic   | p          | none  |
        compressible transonic  | p          | psi   | 1
        compressible supersonic | p          | psi   | > 1
    \endtable

    For most applications the totalPressure boundary condition now only
    requires p0 to be specified e.g.
    outlet
    {
        type            totalPressure;
        p0              uniform 1e5;
    }
2016-06-16 12:21:34 +01:00
Henry Weller
3d98d6e5c6 changeDictionary: Simplified by removing the need for the superfluous dictionaryReplacement sub-dictionary
Added the option '-subDict' to specify a sub-dictionary if multiple
replacement sets are present in the same file.  This also provides
backward compatibility by setting '-subDict dictionaryReplacement'
2016-06-15 09:03:05 +01:00
Chris Greenshields
344f435f54 Tutorials fvSolution files: removed solver entries which use default
values; formatted Switch entries consistently across all cases
2016-06-15 07:39:12 +01:00
Chris Greenshields
3d810c11dc Tutorials: made laplacianSchemes consistent and correct 2016-06-13 23:38:03 +01:00
Henry Weller
3eec5854be Standardized the selection of required and optional fields in BCs, fvOptions, functionObjects etc.
In most boundary conditions, fvOptions etc. required and optional fields
to be looked-up from the objectRegistry are selected by setting the
keyword corresponding to the standard field name in the BC etc. to the
appropriate name in the objectRegistry.  Usually a default is provided
with sets the field name to the keyword name, e.g. in the
totalPressureFvPatchScalarField the velocity is selected by setting the
keyword 'U' to the appropriate name which defaults to 'U':

        Property     | Description             | Required    | Default value
        U            | velocity field name     | no          | U
        phi          | flux field name         | no          | phi
        .
        .
        .

However, in some BCs and functionObjects and many fvOptions another
convention is used in which the field name keyword is appended by 'Name'
e.g.

        Property     | Description             | Required    | Default value
        pName        | pressure field name     | no          | p
        UName        | velocity field name     | no          | U

This difference in convention is unnecessary and confusing, hinders code
and dictionary reuse and complicates code maintenance.  In this commit
the appended 'Name' is removed from the field selection keywords
standardizing OpenFOAM on the first convention above.
2016-05-21 20:28:20 +01:00
Henry Weller
83c7e97655 dynamicCode: Renamed 'redirectType' to 'name' to clarify the purpose
of the entry which is to provide the name of the generated class.

'redirectType' is supported for backward-compatibility.
2016-05-18 23:10:42 +01:00
Henry Weller
83bae2efd3 functionObjects: Renamed dictionary entry 'functionObjectLibs' -> 'libs'
This changes simplifies the specification of functionObjects in
controlDict and is consistent with the 'libs' option in controlDict to
load special solver libraries.

Support for the old 'functionObjectLibs' name is supported for backward compatibility.
2016-05-16 22:09:01 +01:00
Henry Weller
78d2971b21 functionObjects: rewritten to all be derived from 'functionObject'
- Avoids the need for the 'OutputFilterFunctionObject' wrapper
  - Time-control for execution and writing is now provided by the
    'timeControlFunctionObject' which instantiates the processing
    'functionObject' and controls its operation.
  - Alternative time-control functionObjects can now be written and
    selected at run-time without the need to compile wrapped version of
    EVERY existing functionObject which would have been required in the
    old structure.
  - The separation of 'execute' and 'write' functions is now formalized in the
    'functionObject' base-class and all derived classes implement the
    two functions.
  - Unnecessary implementations of functions with appropriate defaults
    in the 'functionObject' base-class have been removed reducing
    clutter and simplifying implementation of new functionObjects.
  - The 'coded' 'functionObject' has also been updated, simplified and tested.
  - Further simplification is now possible by creating some general
    intermediate classes derived from 'functionObject'.
2016-05-15 16:40:01 +01:00
Henry Weller
cf4b35693c tutorials: Remove the unnecessary "\"s on "cp", "rm" and "mv"
Resolves bug-report http://bugs.openfoam.org/view.php?id=2077
2016-05-05 15:17:55 +01:00
Henry Weller
1b34231340 tutorials: Renamed .org -> .orig
See http://www.openfoam.org/mantisbt/view.php?id=2076
  - .org is the file extension for emacs org-mode as well
  - .orig is more to the point (.org isn't always recognized as "original")
  - .original is too long, although more consistent with the convention
    of source code file naming

Update script contributed by Bruno Santos
2016-04-30 21:53:50 +01:00
Henry Weller
c9a57e4009 tutorials/combustion/fireFoam/les: Added missing ph_rgh.orig files 2016-04-27 16:18:25 +01:00
Henry Weller
673e0d1704 fireFoam: Added optional hydrostatic initialization of the pressure and density
Also added the new prghTotalHydrostaticPressure p_rgh BC which uses the
hydrostatic pressure field as the reference state for the far-field
which provides much more accurate entrainment is large open domains
typical of many fire simulations.

The hydrostatic field solution is controlled by the optional entries in
the fvSolution.PIMPLE dictionary, e.g.

    hydrostaticInitialization yes;
    nHydrostaticCorrectors 5;

and the solver must also be specified for the hydrostatic p_rgh field
ph_rgh e.g.

    ph_rgh
    {
        $p_rgh;
    }

Suitable boundary conditions for ph_rgh cannot always be derived from
those for p_rgh and so the ph_rgh is read to provide them.

To avoid accuracy issues with IO, restart and post-processing the p_rgh
and ph_rgh the option to specify a suitable reference pressure is
provided via the optional pRef file in the constant directory, e.g.

    dimensions      [1 -1 -2 0 0 0 0];
    value           101325;

which is used in the relationship between p_rgh and p:

    p = p_rgh + rho*gh + pRef;

Note that if pRef is specified all pressure BC specifications in the
p_rgh and ph_rgh files are relative to the reference to avoid round-off
errors.

For examples of suitable BCs for p_rgh and ph_rgh for a range of
fireFoam cases please study the tutorials in
tutorials/combustion/fireFoam/les which have all been updated.

Henry G. Weller
CFD Direct Ltd.
2016-04-23 10:04:39 +01:00
Henry Weller
4bc77e6aff Sprucing up the tutorials folder and adding -dict to "collapseEdges"
Patch provided by Bruno Santos
Resolves patch application request http://www.openfoam.org/mantisbt/view.php?id=2015
2016-03-06 19:06:44 +00:00
Henry Weller
acac7d786b tutorials: Added missing 'value' entry for 'calculatedFvPatchField's 2016-02-24 16:21:50 +00:00
Henry Weller
271935c1bf calculatedFvPatchField: 'value' entry is now required to avoid problems with non-initialization 2016-02-24 16:01:40 +00:00
Henry Weller
979e1ee191 tutorials/combustion/reactingFoam: ras -> laminar 2016-02-19 15:13:52 +00:00
Henry Weller
350d03246e scripts: Reformat with consistent section separators 2016-02-15 18:30:24 +00:00
Henry Weller
cfa7678ba8 foamRunTutorials: Rationalized support for the "-test" option
RunFunctions: Added "isTest()" argument parsing function
tutorials: Updated Allrun scripts to propagate the "-test" option
tutorials: Removed the lower Alltest scripts and updated the Allrun to
    use the "isTest()" function to handle test-specific operation
2016-02-15 15:49:05 +00:00
Henry Weller
daf44fda3d tutorials and templates: Updated wall BC for velocity to noSlip 2016-02-09 20:08:34 +00:00
Henry Weller
b3d47f0423 bin/tools/RunFunctions: runParallel now obtains the number of processors from numberOfSubdomains
in decomposeParDict.

This default number of processors may be overridden by the new "-np"
option to runParallel which must be specified before the application
name e.g.:

runParallel -np 4 pisoFoam
2016-01-27 14:19:25 +00:00
Henry Weller
85c79d8398 fvOptions: New buoyancyForce and buoyancyEnergy
Provides run-time selection of buoyancy sources for compressible solvers

Replaces the built-in buoyancy sources in XiFoam, reactingFoam and
rhoReactingFoam.

e.g. in constant/fvOptions specify

momentumSource
{
    type            buoyancyForce;

    buoyancyForceCoeffs
    {
        fieldNames      (U);
    }
}

and optionally specify the buoyancy energy source in the enthalpy
equation:

energySource
{
    type            buoyancyEnergy;

    buoyancyEnergyCoeffs
    {
        fieldNames      (h);
    }
}

or internal energy equation

energySource
{
    type            buoyancyEnergy;

    buoyancyEnergyCoeffs
    {
        fieldNames      (e);
    }
}
2015-11-23 09:29:10 +00:00
Henry Weller
62945ab1ea chemFoam: Remove unused turbulence model 2015-11-21 18:30:35 +00:00
Henry Weller
093b4aade6 chemkinReader: Add support for reading transport properties from dictionary
Note the dictionary is in OpenFOAM format not CHEMKIN.

Patch provided by Daniel Jasinski
Resolves feature request http://www.openfoam.org/mantisbt/view.php?id=1888
2015-11-20 18:55:36 +00:00
Henry Weller
c1c7b30220 tutorials/combustion/fireFoam/les/smallPoolFire.*: Minor correction 2015-11-15 18:10:28 +00:00
Henry Weller
f4695953aa tutorials/combustion/fireFoam/les/oppositeBurningPanels: Improved schemes and BCs 2015-11-14 19:31:06 +00:00
Henry Weller
d98136e122 tutorials: Removed unnecessary "boundary" files 2015-11-13 20:05:37 +00:00
Henry Weller
d84db55bd4 tutorials/combustion/fireFoam/les/smallPoolFire?D: Improved outlet BC
Now applies totalPressure and pressureInletOutletVelocity with hRef set
to the height of the outlet plane.
2015-11-13 14:17:07 +00:00
Henry Weller
fb2eacf2f1 tutorials/combustion/fireFoam/les/smallPoolFire?D: Improved outlet BC
Now applies totalPressure and pressureInletOutletVelocity with hRef set
to the height of the outlet plane.
2015-11-13 14:15:19 +00:00
Henry Weller
37cfc3ab46 tutorials: Removed unnecessary spaces between parentheses and values in vectors 2015-07-21 20:55:44 +01:00
Henry Weller
4c21f24a8c Input of dimensionedScalars: update read-construction of dimensionedScalar in applications
so that the specification of the name and dimensions are optional in property dictionaries.

Update tutorials so that the name of the dimensionedScalar property is
no longer duplicated but optional dimensions are still provided and are
checked on read.
2015-07-20 22:52:53 +01:00
Henry Weller
0fb6a01280 fluxRequired: Added setFluxRequired function to fvSchemes class
Added calls to setFluxRequired for p, p_rgh etc. in all solvers which
avoids the need to add fluxRequired entries in fvSchemes dictionaries.
2015-07-15 21:57:16 +01:00
Henry Weller
f92d657ab7 LTS: Formalize the naming of the rDeltaT and rSubDeltaT fields
Now the specification of the LTS time scheme is simply:

ddtSchemes
{
    default         localEuler;
}
2015-06-28 21:41:40 +01:00
Henry Weller
64e831fea0 reactingFoam: Added run-time selectable LTS support replacing LTSReactingFoam
Select LTS via the ddtScheme:

    ddtSchemes
    {
        default         localEuler rDeltaT;
    }
2015-06-27 22:35:49 +01:00
Henry
d36657a9f1 tutorials/combustion/reactingFoam/ras/counterFlowFlame2D/0/N2: Correct name
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1706
2015-05-25 10:39:50 +01:00