Commit Graph

635 Commits

Author SHA1 Message Date
76ba65be69 tutorials: Clean up geometry resources
A surface geometry file should be stored in
$FOAM_TUTORIALS/resources/geometry if it is used in multiple cases,
otherwise it should be stored locally to the case. This change enforces
that across all tutorials.
2019-11-01 12:32:33 +00:00
bcc86701bc specieTransfer: Added adsorption boundary condition
An adsorption condition has been added for species mass fraction. This
models a surface on which one or more species deposit at a rate
proportional to the quantity of that specie present. The property that
the rate is assumed proportional to can be chosen to be mass fraction,
mole fraction, molar concentration, or partial pressure.

Example specification in 0/CH4, 0/O2, etc...:

    <patchName>
    {
        type            adsorptionMassFraction;
        property        molarConcentration;
        c               1e-3; // <-- Transfer coefficient
        value           $internalField;
    }

"c" is the constant of proportionality between the property value and
the mass transfer rate. If a specie does not adsorb, this should be set
to zero, or be omitted entirely.

This condition must be supplied for all species, and corresponding
specie transfer boundary conditions must also be applied to velocity and
temperature.

Example specification in 0/U and 0/T:

    <patchName>
    {
        type            specieTransferVelocity;
        value           $internalField;
    }

    <patchName>
    {
        type            specieTransferTemperature;
        value           $internalField;
    }

In addition, the semi-permeable baffle conditions have been refactored
to share functionality with the new adsorption conditions. They can now
also be used with the species-transfer temperature condition, which
corrects an energy error that was present previously. The parameter
"input" has been renamed "property", consistently with the adsorption
entries listed above. Molar concentration has also been added as an
option for the property driving the transfer, so the available controls
are the same as for adsorption.

Example specification in 0/CH4, 0/O2, etc...:

    <patchName>
    {
        type            semiPermeableBaffleMassFraction;
        samplePatch     <neighbourPatchName>;
        property        molarConcentration;
        c               1e-3; // <-- Transfer coefficient
        value           $internalField;
    }
    <neighbourPatchName>
    {
        type            semiPermeableBaffleMassFraction;
        samplePatch     <patchName>;
        property        molarConcentration;
        c               1e-3; // <-- Transfer coefficient
        value           $internalField;
    }

Velocity and temperature conditions should be set in the same way as for
adsorption.

In order for the temperature condition to function satisfactorily and
not introduce unphysical variations in temperature as a result of the
linearisation to an energy boundary condition, two new base classes for
temperature conditions which explicitly set the parameters of either
gradient or mixed energy conditions have been added. The mixed condition
forms the base of the specieTransferTemperature condition.

As a result of its generalisation, the library has been renamed from
"libsemiPermeableBaffle.so" to "libspecieTransfer.so".
2019-10-31 16:45:14 +00:00
640027e73a solidDisplacementFoam: Updated thermophysical property handling to use solidDisplacementThermo
derived from solidThermo.  This allows the standard heat transfer boundary
conditions, for example externalWallHeatFluxTemperature, to be used with
solidDisplacementFoam and also significantly simplifies the code.

Additionally solidDisplacementFoam and solidEquilibriumDisplacementFoam have
been updated to handle spatially varying physical properties in a conservative
manner both for the stress and heat transfer.  This means that the stress field
sigma is now dynamic rather than kinematic as it was previously.  For uniform
property fields the behaviour of the solvers is the same as it was before this
update.
2019-10-30 15:17:34 +00:00
ba49dfa991 Reactions: Removed "Reaction" from the end of the reaction names
This part of the name is unnecessary, as it is clear from context that
the name refers to a reaction. The selector has been made backwards
compatible so that old names will still read successfuly.
2019-10-25 10:37:13 +01:00
ace3d0e06d Reactions: Camel-cased all reaction names
Reaction names are now consistently camel-cased for readability. Most
names have not been affected because the reaction rate name is a proper
noun and is therefore already capitalised (e.g., Arrhenius, Janev,
Landau, etc ...). Reactions that have been affected are as follows.

    Old name                                              New name

    irreversibleinfiniteReaction                          irreversibleInfiniteReaction
    irreversiblepowerSeriesReaction                       irreversiblePowerSeriesReaction
    irreversiblethirdBodyArrheniusReaction                irreversibleThirdBodyArrheniusReaction
    nonEquilibriumReversibleinfiniteReaction              nonEquilibriumReversibleInfiniteReaction
    nonEquilibriumReversiblethirdBodyArrheniusReaction    nonEquilibriumReversibleThirdBodyArrheniusReaction
    reversibleinfiniteReaction                            reversibleInfiniteReaction
    reversiblepowerSeriesReaction                         reversiblePowerSeriesReaction
    reversiblethirdBodyArrheniusReaction                  reversibleThirdBodyArrheniusReaction
    irreversiblefluxLimitedLangmuirHinshelwoodReaction    irreversibleFluxLimitedLangmuirHinshelwoodReaction
    irreversiblesurfaceArrheniusReaction                  irreversibleSurfaceArrheniusReaction
    reversiblesurfaceArrheniusReaction                    reversibleSurfaceArrheniusReaction
2019-10-25 10:37:02 +01:00
7ab73932cf Function1: Generalisation and removal of unused code
Function1 has been generalised in order to provide functionality
previously provided by some near-duplicate pieces of code.

The interpolationTable and tableReader classes have been removed and
their usage cases replaced by Function1. The interfaces to Function1,
Table and TableFile has been improved for the purpose of using it
internally; i.e., without user input.

Some boundary conditions, fvOptions and function objects which
previously used interpolationTable or other low-level interpolation
classes directly have been changed to use Function1 instead. These
changes may not be backwards compatible. See header documentation for
details.

In addition, the timeVaryingUniformFixedValue boundary condition has
been removed as its functionality is duplicated entirely by
uniformFixedValuePointPatchField.
2019-10-23 13:13:53 +01:00
dcf4d0c505 Function1: Implemented integral evaluations
Integral evaluations have been implemented for all the ramp function1-s,
as well as the sine and square wave. Bounds handling has also been added
to the integration of table-type functions.

In addition, the sine wave "t0" paramater has been renamed "start" for
consistency with the ramp functions.
2019-10-22 08:31:29 +01:00
280c055ef6 functionObjects::comfort: New functionObject to calculate fields relating to thermal comfort
Description
    Calculates the thermal comfort quantities predicted mean vote (PMV) and
    predicted percentage of dissatisfaction (PPD) based on DIN ISO EN 7730:2005.

Usage
    \table
        Property      | Description                  | Required  | Default value
        clothing      | The insulation value of the cloth | no   | 0
        metabolicRate | The metabolic rate      | no        | 0.8
        extWork       | The external work        | no        | 0
        Trad          | Radiation temperature | no | -1
        relHumidity   | Relative humidity of the air | no | 50
        pSat          | Saturation pressure of water | no | -1
        tolerance     | Residual control for the cloth temperature | no | 1e-5
        maxClothIter  | Maximum number of iterations | no       | 0
        meanVelocity  | Use a constant mean velocity in the whole domain | no |\
        false
    \endtable

    \table
        Predicted Mean Vote (PMV)   | evaluation
        + 3                         | hot
        + 2                         | warm
        + 1                         | slightly warm
        + 0                         | neutral
        - 1                         | slightly cool
        - 2                         | cool
        - 3                         | cold
    \endtable

    \verbatim
    comfortAnalysis
    {
        type            comfort;
        libs            ("libfieldFunctionObjects.so");

        executeControl  writeTime;
        writeControl    writeTime;
    }
    \endverbatim

The new tutorial case heatTransfer/buoyantSimpleFoam/comfortHotRoom is provided
to demonstrate the calculation of PMV and PPD using the comfort functionObject.

This work is based on code and case contributed by Tobias Holzmann.
2019-10-19 23:08:34 +01:00
9b21cf6993 tutorials/heatTransfer/buoyantSimpleFoam/iglooWithFridges: Improved convergence 2019-10-18 16:25:12 +01:00
81fca4c43a Corrected typos in comments
found using cspell.

Patch contributed by Timo Niemi, VTT.
2019-10-18 11:46:20 +01:00
2b0c5028a4 Corrected typos in comments and in name of solidEquilibriumEnergySource fvOption
Patch contributed by Timo Niemi, VTT.
Resolves bug report https://bugs.openfoam.org/view.php?id=3369
2019-10-14 09:21:43 +01:00
4f1ee482ec Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2019-10-10 16:17:17 +01:00
e62ded842f functionObjects::age: Added caching of the age field
to allow post-processing, e.g. sampling, cutting planes, averaging etc.
2019-10-10 16:16:24 +01:00
96f10fa31a reacting*EulerFoam: Various consistency improvements
Mass transfer rates now have a more comprehensive naming convention.
"dmdt" means a bulk/mixture transfer, whilst "dmidt" is for a
specie-specific transfer. "dmdt" implies a transfer into a phase, whilst
"dmdtf" means a transfer across an interface. Tables or lists of
transfers are denoted by pluralising the name with the suffix "s"; e.g.,
"dmdtfs". All registered mass transfer rate fields have names which
include the name of the sub-model or phase system which generated them.

The phaseTransfer models have been changed so that the mixture and the
specie-specific mass transfers are independent. This simplifies the
naming convention required for registering the resulting mass transfers
and reduces the amount of logic necessary in the phase system.

The inheritance pattern of the alphat wall functions has been altered so
that the code and parameters relating to phase change are reused, and so
that the base (the Jayatilleke wall function) more closely resembles the
library implementation. This should make it easier to remove it when the
library function is generalised enough to use it directly.

The phaseSystem::zero*Field construction functions have been removed as
their behaviour regarding registration was not clear, and in most
instances of their usage the GeometriField<...>::New methods are
similarly convenient.
2019-10-10 09:31:40 +01:00
7381f45d03 reacting*EulerFoam: PhaseTransferPhaseSystem: Added non uniform specie transfer support
This change extends phaseTransferModel and PhaseTransferPhaseSystem to
allow non-uniform specie transfer between phases.

A reactionDriven phaseTransfer model is added which represents change of
selected species from one phase to another due to a reaction occurring
within one of the phases.

Following the change, the reactionDriven nucleation models and the
phaseChange drift models in populationBalanceModel have been updated to
use the new functionality in PhaseTransferPhaseSystem. The
PopulationBalancePhaseSystem has been simplified significantly as a
result.

The functionality is demonstrated by a tutorial case simulating the
vapour phase synthesis of titania by titanium tetrachloride oxidation
where both nucleation and surface reactions models are active at the
same time.

Patch contributed by VTT Technical Research Centre of Finland Ltd and
Institute of Fluid Dynamics, Helmholtz-Zentrum Dresden - Rossendorf (HZDR).
2019-10-09 16:53:35 +01:00
a2a74cbb79 functionObjects::age: add optinoal diffusion term and convergence control
to enable the calculation of the residence time for a fluid; mainly used in HVAC
analysis. E.g. residence time of air inside a ventilated room, see the new
tutorial roomResidenceTime.

Contributed by Tobias Holzmann
2019-10-08 16:14:38 +01:00
c8ab2a6e0c tutorials: Updated and simplified using the blockMesh defaultPatch entry
Rather than defining patches for all external block faces to provide name and
type use the defaultPatch entry to collect undefined faces into a single named
and typed patch, e.g.

defaultPatch
{
    name walls;
    type wall;
}
2019-10-07 16:49:11 +01:00
be0ccd2e38 tutorials/multiphase/interFoam/RAS/floatingObject: Removed temporary force restraint 2019-10-04 16:51:56 +01:00
639a90c645 rigidBodyDynamics::restraints::externalForce: New restraint to apply a time-varying force
Description
    Time-dependent external force restraint using Function1.

Usage
    Example applying a constant force to the floatingObject:
    restraints
    {
        force
        {
            type        externalForce;
            body        floatingObject;
            location    (0 0 0);
            force       (100 0 0);
        }
    }

Based on code contributed by SeongMo Yeon
Resolves contribution request https://bugs.openfoam.org/view.php?id=3358
2019-10-04 16:45:22 +01:00
d94a7bf590 tutorials/incompressible/simpleFoam/turbineSiting: Replaced file copying with foamDictionary and .orig 2019-10-01 15:00:55 +01:00
826c380fa3 tutorials/lagrangian/reactingParcelFoam/splashPanel: Resolved divergence
The side surfaces in this tutorial have been made symmetry planes to
match the corresponding boundaries in the film region, and the top has
had its pressure condition changed to totalPressure. The case now runs
successfully to completion.

Previously the pressure-velocity boundary condition combination on the
non-film patches was incorrect in that in regions of outflow a pressure
value was not being specified. This resulted in divergence.
2019-10-01 13:39:26 +01:00
54f379f668 Changed species' diffusivity to alphaEff
All multi-specie solvers function on the assumption that the
mass-diffusivities of the different species are the same. A consequence
of this is that the diffusivities of energy and mass must be the same,
otherwise mass diffusivity results in unphysical temperature
fluctuations. This change enforces this requirement across all
multi-species solvers.

For the same reason, the turbulent Schmidt number has been removed from
the multi-component phase model in reactingEulerFoam. In order to obey
physical constraints this Schmidt number had to be exactly the same as
the Prandtl number. This condition is now enforced by the solver, rather
than relying on the input being correct.
2019-09-30 16:32:39 +01:00
474962ffcc reacting*EulerFoam: Pair-storage and specification of interface composition models
Interface composition models are now specified in
constant/phaseProperties like so:

   interfaceComposition.gas
   (
        (gas and water)
        {
            // ...
        }
        (gas and oil)
        {
            // ...
        }
   );
   interfaceComposition.water
   (
        (water and gas)
        {
            // ...
        }
        // ...
   );
   // ...

I.e., the models associated with diffusive transfer within a phase
"<phase>" are specified in the list "interfaceComposition.<phase>".
Within the list, models are specified in unordered phase pairs
corresponding to the interface.

This replaces a system where models were specified in a single
interfaceComposition list, with the ordered pair entry "(<phase1> in
<phase2>)" meaning transfer within phase1 at the interface with phase2.
This ordered pair syntax is otherwise used for distinguishing between
continuous and dispersed phases. This dual meaning was considered
counter-intuitive. The new entries also more closely resemble the
associated two-resistance heat and mass transfer model specifications.
2019-09-23 09:13:14 +01:00
396c552949 reacting*EulerFoam: Renamed massTransfer models diffusiveMassTransfer
There are now many types of mass transfer, so massTransfer is now too
generic a term for what these models do. These models generate a
diffusivity which when multiplied by a concentration difference results
in mass transfer, hence the new name.

This change is not backwards compatible. Cases running the interface
composition system will need "massTransfer" entries renamed to
"diffusiveMassTransfer".
2019-09-23 08:43:29 +01:00
b77dacd0b9 tutorials/*/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving: Fixed air properties 2019-09-19 17:01:39 +01:00
a79786f7c8 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2019-09-16 09:00:03 +01:00
0284c2c906 tutorials/incompressible/simpleFoam/pitzDaily: Removed duplicate functions entry 2019-09-16 08:59:27 +01:00
7651bbaf62 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting: Restored endTime 2019-09-12 11:24:23 +01:00
d1acbe25bb tutorials/combustion/reactingFoam/RAS/membrane: Clean up
Removed unused species and made the schemes appropriate for a
non-orthogonal mesh.
2019-09-10 11:01:22 +01:00
d4042c0e49 tutorials/reactingTwoPhaseEulerFoam/.../titaniaSynthesis: Corrected parameters and fixed file permissions
Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum Dresden -
Rossendorf (HZDR) and VTT Technical Research Centre of Finland Ltd.
2019-09-09 09:31:33 +01:00
f84708c689 mixtureKEpsilon: Added a phase fraction limiter for bubble generated turbulence
The new optional entry alphap is the as phase fraction below which bubble
generated turbulence is included.  The default is 1 for backward compatibility.

The purpose of this limiter is to avoid spurious turbulence generation at and
around the interface where bubbles are not present.
2019-09-06 17:55:42 +01:00
9066479c86 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting: Reduced write frequency 2019-09-05 09:21:16 +01:00
f75da73d7a DTCHullMoving: Updated for consistency with the current DTCHull tutorial case 2019-09-03 10:11:43 +01:00
dbe9fb3b76 functionObjectList: Removed warning for optional entries
Simplified the residuals functionObject call in the tutorials
2019-09-01 21:16:37 +01:00
6e9801e7e8 functionObjectList: Added support for arguments to added to the object list
If the functionObject requires an object list rather than a field list the
non-named arguments are now inserted into the object list, for example

functions
{
    #includeFunc writeObjects(kEpsilon:G)
}

which is equivalent to

functions
{
    #includeFunc writeObjects(objects = (kEpsilon:G))
}
2019-09-01 15:30:09 +01:00
30cceb42c0 objectRegistry: Corrected caching of registered temporary objects
For example the generation term in the k-epsilon turbulence kEpsilon:G is a
temporary field that is specifically named and registered so that it can be
looked-up be the wall-function boundary conditions and requires slightly
different handling compared to normal temporary fields which are not registered.

The tutorials/incompressible/simpleFoam/pitzDaily case now demostrates this
functionality with the addition of

cacheTemporaryObjects
(
    kEpsilon:G
);

functions
{
    #includeFunc writeObjects(objects = (kEpsilon:G))
}

in controlDict which caches kEpsilon:G and writes it at every write time.
2019-09-01 10:18:45 +01:00
4817971e13 rPolynomial: New equation of state for liquids and solids
Description
    Reciprocal polynomial equation of state for liquids and solids

    \f[
        1/\rho = C_0 + C_1 T + C_2 T^2 - C_3 p - C_4 p T
    \f]

    This polynomial for the reciprocal of the density provides a much better fit
    than the equivalent polynomial for the density and has the advantage that it
    support coefficient mixing to support liquid and solid mixtures in an
    efficient manner.

Usage
    \table
        Property     | Description
        C            | Density polynomial coefficients
    \endtable

    Example of the specification of the equation of state for pure water:
    \verbatim
    equationOfState
    {
        C (0.001278 -2.1055e-06 3.9689e-09 4.3772e-13 -2.0225e-16);
    }
    \endverbatim
    Note: This fit is based on the small amount of data which is freely
    available for the range 20-65degC and 1-100bar.

This equation of state is a much better fit for water and other liquids than
perfectFluid and in general polynomials for the reciprocal of the density
converge much faster than polynomials of the density.  Currently rPolynomial is
quadratic in the temperature and linear in the pressure which is sufficient for
modest ranges of pressure typically encountered in CFD but could be extended to
higher order in pressure and/temperature if necessary.  The other huge advantage
in formulating the equation of state in terms of the reciprocal of the density
is that coefficient mixing is simple.

Given these advantages over the perfectFluid equation of state the libraries and
tutorial cases have all been updated to us rPolynomial rather than perfectFluid
for liquids and water in particular.
2019-08-31 11:57:17 +01:00
888cb50536 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubblePipe: Referencing 2019-08-29 17:01:57 +01:00
9adf943be1 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubblePipe: Added turbulence settings 2019-08-29 14:22:57 +01:00
2be90fd7b2 tutorials/multiphase/reactingTwoPhaseEulerFoam: Added bubblePipe tutorial
Patch contributed by Juho Peltola, VTT.
2019-08-29 12:21:58 +01:00
20d2492c0e tutorials/heatTransfer, lagrangian: replaced the icoPolynomial with perfectGas for air
and with perfectFluid for water.  These choices are more accurate and easier to
specify than icoPolynomial and provide correct mixing.
2019-08-28 16:58:29 +01:00
627f1810f4 tutorials::DTCHull: No need to renumber fields before setFields 2019-08-22 21:35:00 +01:00
f103a18d6e tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting: Removed unused files and entries
Resolves bug report https://bugs.openfoam.org/view.php?id=3332
2019-08-22 10:13:20 +01:00
c5d4d5e17b plateHole/system/singleGraph: Removed unnecessary sub-dictionary 2019-08-20 23:35:56 +01:00
19999767f3 tutorials/combustion/reactingFoam/RAS/SandiaD_LTS: Corrected controlDict 2019-08-15 08:59:30 +01:00
ba7f87fe76 solidChemistryModel: Removed pending a rewrite based on the latest StandardChemistryModel
solidChemistryModel is not implemented in a general way but specialised to form
the basis of the highly specific pyrolysis mode.  The handling of reactions is
hard-coded for forward reactions only, the Jacobian was present but incomplete
so any ODE solvers requiring the Jacobian would either fail, diverge or produce
incorrect results.  It is not clear if many or any parts of the
solidChemistryModel are correct, in particular there is no handling for the
solid surface area per unit volume.  After a lot of refactoring work it has
become clear that solidChemistryModel needs a complete rewrite and can benefit
from all the recent development work done on the now more general
StandardChemistryModel.
2019-08-13 15:44:39 +01:00
8d00f37425 tutorials: reactingEulerFoam: wallBoiling*: Corrected name of zero wall distance 2019-08-13 10:41:38 +01:00
6ecd5b24ed tutorials: reactingMultiphaseEulerFoam: Removed unnecessary Allclean script 2019-08-13 10:41:38 +01:00
cfbb389fd3 reactingEulerFoam: populationBalanceModel: Added fractal shape modelling support
This change adds representation of the shape of a dispersed phase. A
layer has been added to model the relationship between the
characteristic volume of a sizeGroup and its physical diameter.
Previously this relationship was represented by a constant form factor.

Currently, two shape models are available:

  - spherical

  - fractal (for modelling fractal agglomerates)

The latter introduces the average surface area to volume ratio, kappa,
of the entities in a size group as a secondary field-dependent internal
variable to the population balance equation, which makes the population
balance approach "quasi-"bivariate. From kappa and a constant mass
fractal dimension, a collisional diameter can be derived which affects
the coagulation rates computed by the following models:

  - ballisticCollisions

  - brownianCollisions

  - DahnekeInterpolation

  - turbulentShear

The fractal shape modelling also takes into account the effect of sintering
of primary particles on the surface area of the aggregate.

Further additions/changes:

  - Time scale filtering for handling large drag and heat transfer
    coefficients occurring for particles in the nanometre range

  - Aerosol drag model based on Stokes drag with a Knudsen number based
    correction (Cunningham correction)

  - Reaction driven nucleation

  - A complete redesign of the sizeDistribution functionObject

The functionality is demonstrated by a tutorial case simulating the
vapour phase synthesis of titania by titanium tetrachloride oxidation.

Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum Dresden -
Rossendorf (HZDR) and VTT Technical Research Centre of Finland Ltd.
2019-08-13 10:40:25 +01:00
af2baeb6d1 reactingEulerFoam: New wall boiling tutorials
All reactingEulerFoam wall boiling tutorials have been replaced with
cases that are more representative of real applications.

The wall boiling tutorials for reactingTwoPhaseEulerFoam are:

    RAS/wallBoiling:
        Axi-symmetric wall boiling case with constant bubble diameter

    RAS/wallBoilingPolyDisperse:
        As wallBoiling, but with a homogenous class method population
        balance for modelling the bubble diameters

    RAS/wallBoilingIATE:
        As wallBoiling, but with an interfacial area transport equation
        for modelling the bubble diameters

The wall boiling tutorials for reactingMultiphaseEulerFoam are:

    RAS/wallBoilingPolydisperseTwoGroups:
        As wallBoiling, but with an inhomogenous class method population
        balance for modelling the bubble diameters

Patch contributed by Juho Peltola, VTT.
2019-08-12 10:56:36 +01:00