Commit Graph

517 Commits

Author SHA1 Message Date
aaed26965f nutWallFunction: Added a nutw static function to return the nutWallFunction patchField for a given patch 2019-06-02 13:10:34 +01:00
1e2550b6cd Rationalised wall function implementation to avoid complex and inconsistent coefficients
All wall functions now operate collaboratively, obtaining the Cmu, kappa and E
coefficients and yPlusLam from the nutWallFunction base class.  Now these
optional inputs need only be specified in the nut boundary condition with the k,
epsilon, omega, v2 and f wall functions obtaining these values from there.  This
is much simpler to specify and avoids inconsistencies in the operation of the
wall functions for the different turbulence fields.

The code has also been rationalised and simplified avoiding unnecessary code
and duplication.
2019-05-31 19:40:32 +01:00
fc4d7b92c3 Corrected documentation comment for disabled copy constructors 2019-05-29 15:58:42 +01:00
9140984cf4 Added "= delete" to disabled bitwise copy constructors and assignment operators
Currently these deleted function declarations are still in the private section
of the class declarations but will be moved by hand to the public section over
time as this is too complex to automate reliably.
2019-05-28 15:26:45 +01:00
3ecef91e72 Standardised copy constructor documentation comment 2019-05-27 22:34:32 +01:00
0a3b7a7932 Comment spelling corrections from codespell 2019-05-26 10:56:36 +01:00
30bea84fac C++11 conformance and consistency: Added "move" constructors and assignment operators to OpenFOAM containers
Replaced all uses of complex Xfer class with C++11 "move" constructors and
assignment operators.  Removed the now redundant Xfer class.

This substantial changes improves consistency between OpenFOAM and the C++11 STL
containers and algorithms, reduces memory allocation and copy overhead when
returning containers from functions and simplifies maintenance of the core
libraries significantly.
2019-05-25 17:40:39 +01:00
5203a84a0f PatchFields: Improved documentation of the autoMap and rmap functions 2019-05-03 21:53:13 +01:00
687d56fbf1 Field: Moved FieldMapper mapping functions to FieldMapper and made virtual
This allows easier extension and specialisation of field mapping.
2019-05-02 15:43:32 +01:00
66c81f2e3d IATEsources::randomCoalescence: Protect source from unboundedness in kappai 2019-04-26 10:43:58 +01:00
4cb2466f28 reactingEulerFoam: Reorganised continuity error update to avoid fluid properties being recalculated unnecessarily
in particular avoiding IATE being solved a second time after the energy
solution.
2019-04-25 19:49:53 +01:00
752d764d9c Luo.H: removed stray character in Description 2019-04-05 13:35:57 +01:00
2dd53c898a turbulenceModels/laminar/Giesekus: Giesekus model for visco-elasticity
Implementation of the Giesekus model for visco-elasticity, derived from the new
generalised form of the Maxwell model which now support additional sources.

    Giesekus, H., 1982.
    A simple constitutive equation for polymer fluids based on the
    concept of deformation-dependent tensional mobility.
    J. Non-Newton. Fluid. 11, 69–109.

This implementation is instantiated for incompressible, compressible and VoF
two-phase flow.
2019-03-28 22:10:59 +00:00
aaf4a0bfcc multiphase VoF solvers: Ensure the nHatf surfaceField in interfaceProperties is updated following mesh change 2019-03-19 20:13:40 +00:00
52225b96ab CorrectPhi: Added switch to control evaluation of U boundary conditions
This switch should be on for phi-correction within the time loop, where
the correction simply serves to keep the phi-field up to date before the
U-equation is solved. It should be off for initialisation
phi-correction, as the necessary data to update the conditions may not
yet exist.

Resolves bug report https://bugs.openfoam.org/view.php?id=3198
2019-03-18 16:02:25 +00:00
d41166187a writeEntry: Rationalised for consistency, ease of use and maintainability
The writeEntry form is now defined and used consistently throughout OpenFOAM
making it easier to use and extend, particularly to support binary IO of complex
dictionary entries.
2019-03-14 20:54:10 +00:00
111cdf3a65 solutionControl: Renaming and improved final logic
The sub-loops of the solution control are now named more consistently,
with ambiguously named methods such as finalIter replaced with ones
like finalPimpleIter, so that it is clear which loop they represent.

In addition, the final logic has been improved so that it restores state
after a sub-iteration, and so that sub-iterations can be used on their
own without an outer iteration in effect. Previously, if the
non-orthogonal loop were used outside of a pimple/piso iteration, the
final iteration would not execute with final settings.
2019-02-15 16:55:11 +00:00
2395769513 reactingEulerFoam: Use dimensioned<Type>::lookupOrDefault
The advantage of using this constructor for user-input dimensioned model
parameters is that it handles a variety of input; from just the value to
the full name-dimensions-value set. As more is specified, more is
checked.

Some other minor formatting improvements to the reactingEulerFoam
sub-modeling libraries have also been made.

Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2019-02-05 09:19:01 +00:00
756d10c37c reactingEulerFoam: sizeDistribution: Naming conventions
The keyword which selects how the subset over which the function
operates is generated has been renamed to "selectionMode", to make it
more consistent with other parts of the OpenFOAM (e.g., fvOptions). It
can still take the value "all" or "cellZone". A cell zone is now
specified with a "cellZone", again for consistency.

Error messaging has also been overhauled.

Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2019-02-04 09:18:36 +00:00
860a40d237 reactingEulerFoam: populationBalanceModel: Added breakup and coalescence models
Added the breakup and coalescence models of Lehr et al. (2002), and the
coalescence model of Luo (1993).

Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2019-02-04 09:18:36 +00:00
f6bac37fc9 reactingEulerFoam: populationBalanceModel: Fix to drift term
Prior to this commit, the drift term implementation was invalid for a
ratio x_{i+1}/x_i >= 2 between the characteristic volumes of two
subsequent size groups.

Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
2019-02-04 09:18:36 +00:00
b4a22214a1 populationBalanceModel::binaryBreakupModels::LuoSvendsen: New breakup model
References:
        Luo, H., & Svendsen, H. F. (1996).
        Theoretical model for drop and bubble breakup in turbulent dispersions.
        AIChE Journal, 42(5), 1225-1233.
        Eq. 27, p. 1229.

        Bannari, R., Kerdouss, F., Selma, B., Bannari, A., & Proulx, P. (2008).
        Three-dimensional mathematical modeling of dispersed two-phase flow
        using class method of population balance in bubble columns.
        Computers & chemical engineering, 32(12), 3224-3237.
        Eq. 49, p. 3230.

Patch contributed by Institute of Fluid Dynamics, Helmholtz-Zentrum
Dresden - Rossendorf (HZDR)
2019-02-02 20:17:45 +00:00
67cfa3f257 reactingMultiphaseEulerFoam::multiphaseSystem: Applied the new generalised subCycle
which now handles lists of fields.  This avoids problems with the interaction
between sub-cycling and outer-iteration.
2019-02-01 14:08:49 +00:00
e5532ff568 Changed writeKeyword to the new simpler writeEntry form where appropriate 2019-01-29 22:32:42 +00:00
8b4f866b51 timeVaryingMappedFixedValueFvPatchField: Refactored so the underlying mapping function can be used in other BCs
The new patch field mapping class timeVaryingMappedFvPatchField has been
factored out of the timeVaryingMappedFixedValueFvPatchField BC so that it can be
used to map data onto fields stored within other BCs.

In the process the writeEntryIfDifferent function had to be moved from
fvPatchField to dictionary so that it can still be used in the
timeVaryingMappedFvPatchField class and it made good sense to create the
non-conditional variant writeEntry to simplify the patch field write functions.
This rationalisation has been propagated all other patch fields.
2019-01-29 10:09:38 +00:00
5e2f17a9af populationBalanceModel: phaseChange: Improvements
A number of improvements have been made to the population balance phase
change drift model.

- The model now checks the ordering of the phase pairs and changes the
sign of the drift rate accordingly.

- The phase change mass flux and weights are calculated for each
velocity group, so the drift rate and phase change mass flux should be
consistent for each velocity group.

- By default the phase change mass flux is distributed between the size
groups based on the interfacial area of each group. For backward
compatibility number weighting can be enabled with a new
"numberWeighted" option.

The model now requires the user to provide a list of phase pairs in the
usual parenthesised form, rather than using the name. For example:

    phaseChange
    {
        pairs ((gas and liquid));
    }

Patch contributed by Juho Peltola, VTT.
2019-01-28 16:47:34 +00:00
dc6b7d7803 ThermalPhaseChangePhaseSystem: Fix for building with Clang 2019-01-28 11:59:01 +00:00
7e799e9fef TwoResistanceHeatTransferPhaseSystem: Changed stabilisation term
The stabilisation term for the heat transfer with the interface
temperature has been changed to mirror the local heat transfer in the
phase, rather than an effective heat transfer across both phases. This
makes the stabilisation term match the actual temperature-based transfer
terms more accurately. The difference is particularly significant when
the mass transfer rate is high, and cases of this type gain a
significant stability benefit from this change as a result.

Patch contributed by Juho Peltola, VTT.
2019-01-25 11:00:32 +00:00
653b88d411 ThermalPhaseChangeSystem: Evaluate latent heat at Tsat
Latent heat is now evaluated at Tsat instead of Tf for the thermal phase
change method. This provides a smooth transition of the interface
temperature field as the phase fraction tends to zero.

Patch contributed by Juho Peltola, VTT.
2019-01-24 18:43:35 +00:00
765ae50d32 reactingEulerFoam: phaeseForces: Standardised phase keyword
The phase which the function object relates to is now selected with the
keyword "phase", rather than "phaseName". This is consistent with other
name entries such as the "phi" entry for an inletOutlet boundary.
2019-01-24 14:30:02 +00:00
0dfde5ca4f reactingEulerFoam: heatTransferModel: Added constantNu model
This is a heat transfer model with a constant fixed value for the
Nusselt number. It requires a single "Nu" entry to be specified.

Patch contributed by Juho Peltola, VTT
2019-01-17 09:30:42 +00:00
512ef88e8e reactingEulerFoam: Reinstated diameterModel::correct
This had been removed by commit e1c95941, as most of the time it was
only being used to control writing of the diameter field. IATE does
require it, however, so it has been reinstated for that model.
2019-01-15 14:39:31 +00:00
6dc48b62d9 Changed tmp<volField> and tmp<surfaceField> construction to use the new simpler "New" method
avoiding unnecessary database registration of temporary fields
2018-12-21 18:37:13 +00:00
146a59e46c GeometricField: Temporary fields are no longer registered on the database by default
Registration occurs when the temporary field is transferred to a non-temporary
field via a constructor or if explicitly transferred to the database via the
regIOobject "store" methods.
2018-12-20 11:00:37 +00:00
6faadcb45c Removed the unnecessary ".0" from dimensionedScalar constructors 2018-12-19 14:24:41 +00:00
ae63ebfbe6 reactingMultiphaseEulerFoam: Fixed potential double usage of rho tmp 2018-12-13 16:38:49 +00:00
3c0ce7b152 reactingMultiphaseEulerFoam: Updated EEqns for stationary phase
Resolves bug report https://bugs.openfoam.org/view.php?id=3132
2018-12-13 16:01:49 +00:00
ba76758702 MultiComponentPhaseModel: Rename Sc to Sct
This is to make it clear that this is a turbulent Schmidt number
2018-12-11 11:57:30 +00:00
c39816f032 alphatWallBoilingWallFunction: Fix for clang
Patch contributed by Juho Peltola, VTT.
2018-12-04 12:11:33 +00:00
8d8369a5e7 reactingEulerFoam: corrected file permissions 2018-12-02 20:30:39 +00:00
69b40df84b ThermalPhaseChangePhaseSystem: Consistency when solving for internal energy
The energy transfer associated with phase change has been corrected in
the case that the variable being solved for is internal energy.

Patch contributed by Juho Peltola, VTT.
2018-11-29 11:57:34 +00:00
bcf4e68901 Further rationalisation of the handling of "Final" solver settings
The selection of the "Final" solver settings is now handled automatically within
the "<equation>.solve()" call and there is no longer any need no provide a bool
argument for specific cases.  This simplifies the solution algorithm loop
structures and ensures consistency in behaviour across all solvers.

All tutorials have been updated to correspond to the now consistent rules.
2018-11-20 11:28:02 +00:00
ee443e201f Rationalised the handling of "Final" solver and relaxation factor settings
Now for transient simulations "Final" solver settings are required for ALL
equations providing consistency between the solution of velocity, energy,
composition and radiation properties.

However "Final" relaxation factors are no longer required for fields or
equations and if not present the standard value for the variable will be
applied.  Given that relaxation factors other than 1 are rarely required for
transient runs and hence the same for all iterations including the final one
this approach provide simpler input while still providing the flexibility to
specify a different value for the final iteration if required.  For steady cases
it is usual to execute just 1 outer iteration per time-step for which the
standard relaxation factors are appropriate, and if more than one iteration is
executed it is common to use the same factors for both.  In the unlikely event
of requiring different relaxation factors for the final iteration this is still
possible to specify via the now optional "Final" specification.
2018-11-17 19:42:23 +00:00
3980cc887c interfacialCompositionModels/Henry: Updated documentation
Corrected spelling and made it clear that the supplied constants are
dimensionless solubilities.
2018-11-13 16:15:28 +00:00
1c35e8a2f5 reactingEulerFoam: Added update interval for population balance source terms.
This can be used to speedup simulations that converge to a steady state
by only updating the source terms once every few iterations. The number
of iterations between each update is set in fvSolution as follows:

    solvers
    {
        bubbles
        {
            sourceUpdateInterval 10;
        }

        // etc ...
    }

By default the interval is 1, and so the sources update every time.

Based on a patch contributed by Juho Peltola, VTT.
2018-11-05 09:28:03 +00:00
b7c64995b0 IsothermalPhaseModel: Always correct thermo
Commit 674bff40 was in the right direction, but pressure dependence also
has to be corrected for, whether the phase is pure or not. The phase now
always updates the thermo whilst maintaining a constant temperature.
2018-10-30 15:35:41 +00:00
674bff4031 IsothermalPhaseModel: Correct base thermo
An isothermal phase still needs to trigger a thermo update in it's base
classes, primarily to ensure that any inert species fractions get
updated. This will not trigger an actual update of the thermodynamics,
as that is done in AnisothermalPhaseModel.
2018-10-30 14:27:39 +00:00
e1c95941e7 reactingEulerFoam: Added linearTsub diameter model
This is a model for the diameter of vapour bubbles. It calculates the
diameter as a linear function of the liquid sub-cooling.

Also removed the correct method from diameterModel, as it wasn't really
doing anything except facilitating the update of diameter fields to be
written out. Derived sub-models can control this locally without
polluting the base interface.

Based on patch contributed by by Juho Peltola, VTT.
2018-10-29 14:16:41 +00:00
c9d7131eef driftFluxFoam: Added support for LRR and SSG Reynolds stress models 2018-10-29 12:05:54 +00:00
80cc9603a1 thermophysicalModels::eRefConstThermo: New thermodynamics to be used with internal energy
in preference hRefConstThermo.
2018-10-26 18:19:44 +01:00