Commit Graph

225 Commits

Author SHA1 Message Date
e0e448a8bb slicedFvPatchField, slicedFvsPatchField: Removed from New selection tables
Sliced Fv? patch fields are explicitly constructed and lookup from the
fv?PatchField constructor tables is not necessary or appropriate
2020-07-29 21:51:59 +01:00
6637ed0e9f slicedFvsPatchField: Set empty internal field in constructor
is reset by shallowCopy in SlicedGeometricField
2020-07-29 14:07:57 +01:00
4250d7ce42 Added "using" statements to avoid warning messages from clang 2020-06-02 21:37:36 +01:00
f7bcc19ad2 freestreamVelocity: changed to use mean of patchInternalField and patch value
for valueFraction calculation
2020-04-17 18:46:47 +01:00
b6e3838dbd freestreamVelocityFvPatchVectorField: Constructor call corrected for clang 2020-04-16 22:27:27 +01:00
1a1381d093 freestreamVelocity BC: changed to use patchInternalField for valueFraction calculation
to prevent the valueFraction "locking" to 1 when a velocity points exactly normal and inwards to the face
2020-04-16 12:49:06 +01:00
4f1beb3830 flowRateInletVelocity: Added alpha option for use with interstitial velocities 2020-04-15 09:47:24 +01:00
de66b1be68 MomentumTransportModels: Update of the TurbulenceModels library for all flow types
providing the shear-stress term in the momentum equation for incompressible and
compressible Newtonian, non-Newtonian and visco-elastic laminar flow as well as
Reynolds averaged and large-eddy simulation of turbulent flow.

The general deviatoric shear-stress term provided by the MomentumTransportModels
library is named divDevTau for compressible flow and divDevSigma (sigma =
tau/rho) for incompressible flow, the spherical part of the shear-stress is
assumed to be either included in the pressure or handled separately.  The
corresponding stress function sigma is also provided which in the case of
Reynolds stress closure returns the effective Reynolds stress (including the
laminar contribution) or for other Reynolds averaged or large-eddy turbulence
closures returns the modelled Reynolds stress or sub-grid stress respectively.
For visco-elastic flow the sigma function returns the effective total stress
including the visco-elastic and Newtonian contributions.

For thermal flow the heat-flux generated by thermal diffusion is now handled by
the separate ThermophysicalTransportModels library allowing independent run-time
selection of the heat-flux model.

During the development of the MomentumTransportModels library significant effort
has been put into rationalising the components and supporting libraries,
removing redundant code, updating names to provide a more logical, consistent
and extensible interface and aid further development and maintenance.  All
solvers and tutorials have been updated correspondingly and backward
compatibility of the input dictionaries provided.

Henry G. Weller
CFD Direct Ltd.
2020-04-14 20:44:22 +01:00
876845d0f4 Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev 2020-04-10 09:30:12 +01:00
3f13de8369 Corrected typos
Patch contributed by Timo Niemi, VTT.
2020-04-10 09:26:54 +01:00
ce0cd2fdbd fanPressure, fanPressureJump: Improvements to implementation consistency 2020-04-08 14:38:56 +01:00
6c887be284 Added entrainmentPressure and prghEntrainmentPressure conditions
These provide pressure boundary conditions suitable for use on
boundaries where the flow may reverse or on which the inlet or outlet
state is not known or well defined. The condition takes the following
form:

    p = p0 + 0.5*Un*mag(Un)

In the case of exactly normal inlet velocity, this condition sets the
same pressure as the totalPressure condition. The pressure that is set
increases with increasing outlet velocity and decreases with increasing
inlet velocity. This makes it self-limiting and extremely stable in a
number of configurations which were not easily simulated previously. The
condition also does varies smoothly as the flux reverses, which also
aids stability.

The controls of this boundary condition are exactly the same as for the
totalPressure condition. Note, however, that "p0" is not necessarily the
total pressure any more. It is, in general, a reference pressure.

An example usage is as follows:

    sides
    {
        type    entrainmentPressure;
        p0      100;
    }
2020-04-08 14:31:59 +01:00
a728a69c59 codedMixedFvPatchField, codedFixedValuePointPatchField: Updated and simplified using the new CodedBase class
reducing code duplication and maintenance overhead.
2020-02-07 00:05:27 +00:00
4cbb849eda codedFixedValueFvPatchField: Updated and simplified using the new CodedBase class
reducing code duplication and maintenance overhead.
2020-02-06 16:04:21 +00:00
aff00a2e7e dlLibraryTable: Simplified and rationalised the handling of dynamic library loading
Rather than being tied to the Time class the dlLibraryTable libs is now a global
variable in the Foam namespace which is accessable by any class needing to load
dynamic libraries, in particular argList, Time and codeStream.
2020-01-31 08:18:10 +00:00
5c81c1f478 processorFvPatchField: Removed unnecessary template specialisation 2020-01-05 09:56:25 +00:00
bf6de2bcc2 Rationalised and standardised the naming of neighbour patch functions in the cyclic patch implementations 2020-01-04 19:32:52 +00:00
e9df0c6302 cyclic patches: Removed the unnecessary doTransform virtual function
The transform in conjunction with the rank of the field provide sufficient
information to select the transformation.
2020-01-03 00:34:54 +00:00
fe7f362d57 cyclic patches: Removed unnecessary definitions of and calls to doTransform 2020-01-02 20:27:30 +00:00
4f0e38ce4a cyclic patches: Rationalised the handling of transformation
A single transformer object is now maintained within cyclic patches and returned
from a single virtual functions massively simplifying the interface and allowing
for further rationalisation of the calculation of the transformation.
2020-01-02 17:05:01 +00:00
03207b1538 Coupled patch transformations: Removed the hideous and unphysical non-uniform transformation support
The implementation of the optional non-uniform transformations in coupled
patches was based on transform property lists which could be either length 0 for
no transformation, 1 for uniform transformation or n-faces for non-uniform
transformation.  This complexity was maintenance nightmare but kept to support
the hack in the original film implementation to partially work around the
conservation error.  Now that film has been re-implemented in fully mass
conservative form this unphysical non-uniform transformation support is no
longer needed and the coupled patch transformations have been completely
refactored to be simpler and more rational with single values for the
transformation properties and boolians to indicate which transformations are
needed.
2019-12-25 11:26:30 +00:00
0ad918f659 surfaceFilmModels: Rewritten in mass conservative form
All of the film transport equations are now formulated with respect to the film
volume fraction in the region cell layer rather than the film thickness which
ensures mass conservation of the film even as it flows over curved surfaces and
around corners.  (In the previous formulation the conservation error could be as
large as 15% for a film flowing around a corner.)

The film Courant number is now formulated in terms of the film cell volumetric
flux which avoids the stabilised division by the film thickness and provides a
more reliable estimate for time-step evaluation.  As a consequence the film
solution is substantially more robust even though the time-step is now
significantly higher.  For film flow dominated problem the simulations now runs
10-30x faster.

The inconsistent extended PISO controls have been replaced by the standard
PIMPLE control system used in all other flow solvers, providing consistent
input, a flexible structure and easier maintenance.

The momentum corrector has been re-formulated to be consistent with the momentum
predictor so the optional PIMPLE outer-corrector loop converges which it did not
previously.

nonuniformTransformCyclic patches and corresponding fields are no longer needed
and have been removed which paves the way for a future rationalisation of the
handling of cyclic transformations in OpenFOAM to improve robustness, usability
and maintainability.

Film sources have been simplified to avoid the need for fictitious boundary
conditions, in particular mappedFixedPushedInternalValueFvPatchField which has
been removed.

Film variables previously appended with an "f" for "film" rather than "face"
have been renamed without the unnecessary and confusing "f" as they are
localised to the film region and hence already directly associated with it.

All film tutorials have been updated to test and demonstrate the developments
and improvements listed above.

Henry G. Weller
CFD Direct Ltd.
2019-12-12 10:34:08 +00:00
5eaf74c3a4 dictionary scalar lookup: simplified syntax using the type templated lookup function
Replaced
    readScalar(dict.lookup("name"))
with
    dict.lookup<scalar>("name")
2019-11-27 14:56:32 +00:00
d987648ef4 dictionary label lookup: simplified syntax using the type templated lookup function
Replaced
    readLabel(dict.lookup("name"))
with
    dict.lookup<label>("name)
2019-11-27 11:38:59 +00: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
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
d9fc4501dd pressureInletOutletVelocityFvPatchVectorField: Changed the optional tangentialVelocity entry to a Function1
to support for example flow ramping in towing-tank simulations.
2019-09-03 10:09:12 +01:00
409548cbcc Moved the dictionary keyword type keyType into the dictionary directory
and removed the need for the direct dependency of Ostream on keyType which is
not a primitive IO type and relates specifically to dictionary and not all IO.
2019-08-17 20:22:30 +01:00
91e00b40b4 verbatimString: New string type to handle the code blocks in codeStream
without the need to handle the VERBATIMSTRING token type explicitly everywhere
in the IO sub-system.  Having a specific type is more consistent with the design
and operation of token and much easier to maintain and extend.
2019-08-16 11:35:46 +01:00
4e902bf450 fixedValueFvPatchField: Removed value constructor
The corresponding constructor in the base class was removed as part of a
number of related changes to patch field construction in commit
70021b12.

Resolves bug report https://bugs.openfoam.org/view.php?id=3304
2019-07-11 10:46:00 +01:00
3431c1d21e Updated unit expressions in documentation to new standardised form 2019-07-08 16:05:33 +01:00
96b69f6f88 Standardised and rationalised the way in which units are written in function documentation 2019-06-20 10:54:14 +01:00
8e9f692aa4 Standardised the class declaration section comments to correspond to the foamNewSource template 2019-06-13 21:26:33 +01:00
3ecef91e72 Standardised copy constructor documentation comment 2019-05-27 22:34:32 +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
e4d89daf5d coupledFvPatches: Prevent crashes when operating on processor cases 2019-05-10 16:06:43 +01:00
4f7f488f22 directFieldMapper, setSizeFieldMapper: new specialised field mappers for decomposition and reconstruction
Using the new field mapper framework it is now possible to create specialised
mappers rather than creating a fatter and fatter interface in the base mapper.
This approach is far more extensible, comprehensible and maintainable.
2019-05-09 22:12:44 +01:00
5203a84a0f PatchFields: Improved documentation of the autoMap and rmap functions 2019-05-03 21:53:13 +01:00
b8e15e24b1 fvPatchField: Rationalised autoMap 2019-05-03 13:06:45 +01:00
4b57ee554e Renamed FieldMapper -> fieldMapper: it is an abstract base class for field mapping, not templated 2019-05-03 08:58:13 +01:00
76a8f398aa Field: Replaced autoMap with support in the map functions for mapping to self
Avoids clutter in the interface and code duplication.
2019-05-02 19:05:42 +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
2f3d47ad7e Residuals: New MeshObject class to store solver performance residuals
This is more efficient and modular than the previous approach of storing the
residuals in the mesh data dictionary.
2019-04-04 19:08:08 +01:00
28cebf7020 surfaceNormalUniformFixedValueFvPatchVectorField: New vector boundary condition
Description
    Surface-normal fixed value vector boundary condition

    in which the vector field is obtained by scaling the patch normals
    by the evaluated scalar Function1 provided.

Usage
    \table
        Property     | Description             | Required    | Default value
        uniformValue | uniform value           | yes         |
    \endtable

    Example of the boundary condition specification:
    \verbatim
    <patchName>
    {
        type            surfaceNormalUniformFixedValue;
        uniformValue    constant -0.2;         // 0.2 INTO the domain
    }
    \endverbatim

Note
    Sign conventions:
    - the value is positive for outward-pointing vectors
2019-04-03 17:32:44 +01: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
5e7c0aaac1 swirlFlowRateInletVelocityFvPatchVectorField: Added reduction to patch size
Resolves bug-report https://bugs.openfoam.org/view.php?id=3185
2019-03-05 12:07:19 +00:00
9038895701 swirlInletVelocityFvPatchVectorField: Minor correction to documentation 2019-02-26 09:40:11 +00:00
d31f4f7aae freestream[Pressure|Velocity]FvPatchScalarField: Updated for clang 2019-02-05 22:11:23 +00:00
d3a02cff1e freestreamVelocity/Pressure BC: stabilise in the limit of mag(Up) = 0 2019-02-04 20:55:37 +00:00