|
|
|
<!-- --- title: User Upgrade Guide (OpenFOAM-v2006) -->
|
|
|
|
|
|
|
|
[](/home)
|
|
|
|
[][upgrade-guide]
|
|
|
|
[][code-patterns]
|
|
|
|
|
|
|
|
[[_TOC_]]
|
|
|
|
|
|
|
|
|
|
|
|
## Deprecation and Removal
|
|
|
|
|
|
|
|
### Removed RANS closure model: `v2f`
|
|
|
|
|
|
|
|
- `v2f` RANS turbulence closure model was removed **in the light of lengthy discussions with the OpenFOAM community members** in favour of `kEpsilonPhitF` model. The `v2f` model was based on the work of (Lien and Kalitzin, 2001), which was a reformulation of the original `v2-f` methodology of (Durbin, 1995), reducing the inherent numerical stiffness for the segregated solution algorithms due to the coupled formulations of `v2` and `f` fields, particularly on wall boundaries. However, various shortcomings in terms of model fidelity were reported for this model in the literature. To overcome the shortcomings of the `v2-f` methodology, the `v2-f` approach was re-evaluated by (Laurence et al., 2005) by transforming `v2` scale into its equivalent non-dimensional form, i.e. `phit`, to reduce the numerical stiffness. This variant, i.e. `kEpsilonPhitF`, is believed to provide numerical robustness, and insensitivity to grid anomalies while retaining the theoretical model fidelity of the original `v2-f` model.
|
|
|
|
|
|
|
|
### Removed wall functions: `v2WallFunction` and `fWallFunction`
|
|
|
|
|
|
|
|
- Following the removal of the `v2f` RANS model, the corresponding wall functions, i.e. [fWallFunction](https://develop.openfoam.com/Development/openfoam/-/tree/OpenFOAM-v1912/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/fWallFunctions/fWallFunction) and [v2WallFunction](https://develop.openfoam.com/Development/openfoam/-/tree/OpenFOAM-v1912/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/v2WallFunctions/v2WallFunction) that are not required by the `kEpsilonPhitF` model, were removed.
|
|
|
|
|
|
|
|
### Removed `foamToEnsightParts`
|
|
|
|
|
|
|
|
The `foamToEnsightParts` utility (which was serial only) became redundant due to the improvements made for `foamToEnsight` utility and hence removed.
|
|
|
|
|
|
|
|
## Rename
|
|
|
|
|
|
|
|
- `nutkAtmRoughWallFunction` boundary condition was renamed to `atmNutkWallFunction` without providing backward compatibility for setup in order to be consistent with the rest of the atmospheric model functionality names.
|
|
|
|
- The name of the function object `lambVector` was renamed to [`LambVector`](https://www.openfoam.com/documentation/guides/latest/doc/guide-fos-field-LambVector.html) in order to properly acknowledge [Horace Lamb](https://en.wikipedia.org/wiki/Horace_Lamb)'s legacy.
|
|
|
|
|
|
|
|
|
|
|
|
## Configuration / Environment
|
|
|
|
|
|
|
|
### ParaView plugins
|
|
|
|
|
|
|
|
- Only set PV_PLUGIN_PATH if the directory actually exists.
|
|
|
|
This does mean two passes are required on the initial compilation,
|
|
|
|
but improves reliability thereafter.
|
|
|
|
|
|
|
|
- Handle arbitrary PV_PLUGIN_PATH for `paraFoam` to ease support for
|
|
|
|
plugins that are built outside of the regular OpenFOAM installation.
|
|
|
|
As `paraFoam -help-full` reveals:
|
|
|
|
```
|
|
|
|
-plugin-path=DIR Define plugin directory (default: $PV_PLUGIN_PATH)
|
|
|
|
```
|
|
|
|
|
|
|
|
- If paraview plugins are built (as part of the visualization module)
|
|
|
|
they are now prefixed with `ParaFoam` (eg, `ParaFoamBlockReader` and
|
|
|
|
`ParaFoamReader`) to make them readily identifiable and carry a
|
|
|
|
version corresponding to the OpenFOAM API.
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
### Handling of config directories
|
|
|
|
|
|
|
|
- The `FOAM_CONFIG_MODE` environment variable can be given values such
|
|
|
|
as (`ugo`, `o` etc) to restrict which directories will be searched
|
|
|
|
for etc files during shell sourcing. This improves control, but also
|
|
|
|
enables cluster installations to define their own value within the
|
|
|
|
OpenFOAM prefs.sh file to prevent users accidentally mis-configuring
|
|
|
|
things if necessary.
|
|
|
|
|
|
|
|
- The `FOAM_CONFIG_ETC` environment allows injection of an extra
|
|
|
|
search layer when finding project etc files.
|
|
|
|
|
|
|
|
|
|
|
|
### Shell syntax for foamCreateModuleInclude
|
|
|
|
|
|
|
|
- can pre-generate shell environment for later sourcing as an
|
|
|
|
alternative to sourcing etc/bashrc itself
|
|
|
|
|
|
|
|
|
|
|
|
## Wmake adjustments
|
|
|
|
|
|
|
|
### Additional `wmake` subcommands
|
|
|
|
|
|
|
|
The `wmake` system now has additional _subcommand_ handling that
|
|
|
|
provides a natural means of accessing additional functionality without
|
|
|
|
additional top-level scripts and also allowing better reuse of scripts.
|
|
|
|
|
|
|
|
For example,
|
|
|
|
- `wmake -check-dir` takes 1 or 2 directory names and replaces
|
|
|
|
the standalone script `wmakeCheckPwd` (still available as a symlink).
|
|
|
|
- `wmake -build-info` replaces the infrequently used `wmakeBuildInfo`
|
|
|
|
- `wclean -build` and `wclean -platform` to replace the infrequently
|
|
|
|
used `wcleanBuild` and `wcleanPlatform`, respectively.
|
|
|
|
|
|
|
|
Consolidation and improvements will continue for next version.
|
|
|
|
|
|
|
|
|
|
|
|
### Additional compilation parameters
|
|
|
|
|
|
|
|
The `wmake` system now passes through the following environment
|
|
|
|
parameters:
|
|
|
|
- `FOAM_EXTRA_CFLAGS`
|
|
|
|
- `FOAM_EXTRA_CXXFLAGS`
|
|
|
|
- `FOAM_EXTRA_LDFLAGS`
|
|
|
|
|
|
|
|
to support custom tuning of compilation parameters and situations
|
|
|
|
where additional compilation parameters are required when integrating
|
|
|
|
OpenFOAM code.
|
|
|
|
|
|
|
|
|
|
|
|
### Allwmake overrides
|
|
|
|
|
|
|
|
Preferentially handle a `Allwmake.override` script, which allows
|
|
|
|
packaging tools to define alternative `Allwmake` scripts, or even
|
|
|
|
selectively disable components.
|
|
|
|
|
|
|
|
|
|
|
|
### More portable paths
|
|
|
|
|
|
|
|
The binaries for the wmake toolchain (wmkdepend, lemon, ...) are now
|
|
|
|
located under `platforms/tools` (previously installed under
|
|
|
|
`wmake/platforms`). This aids when creating source-only or binary-only
|
|
|
|
packages.
|
|
|
|
|
|
|
|
|
|
|
|
### Easier handling of compiler derivatives
|
|
|
|
|
|
|
|
It is now possible to split on a `[-+.~]` qualify to create compiler
|
|
|
|
variants. Such as the following:
|
|
|
|
|
|
|
|
- simple readable names such as `WM_COMPILER=Clang-vendor`
|
|
|
|
- future definition of combining different information.
|
|
|
|
For example,
|
|
|
|
```
|
|
|
|
WM_COMPILER=Clang~openmp
|
|
|
|
WM_COMPILER=Clang+cuda~openmp
|
|
|
|
```
|
|
|
|
using `+` (add) and `~` (subtract) notation similar to what
|
|
|
|
spack uses.
|
|
|
|
|
|
|
|
|
|
|
|
### Optional override wmake rules
|
|
|
|
|
|
|
|
Support optional _override_ wmake rules. If present, the
|
|
|
|
compiler-family `override` rules are included after compiler-family
|
|
|
|
`general` rules have been included. This allows a central means for
|
|
|
|
including dynamically generated content to override some values.
|
|
|
|
|
|
|
|
For example, to handle different gcc versions (system compiler)
|
|
|
|
`wmake/rules/linux64Gcc/override` could contain the following:
|
|
|
|
```
|
|
|
|
ifneq (,$(findstring 9, $(WM_COMPILER)))
|
|
|
|
cc := gcc-9
|
|
|
|
CC := g++-9 -std=c++11
|
|
|
|
endif
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Improved granularity and encapsulation for MPI-rebuilds
|
|
|
|
|
|
|
|
Additional `Allwmake-mpi` scripts are provided for handling the
|
|
|
|
MPI-only build segment. The relevant sections now use a
|
|
|
|
`FOAM_MPI_LIBBIN` target location (normally defaults to
|
|
|
|
`FOAM_LIBBIN/FOAM_MPI`) that allows for builds with out-of-tree
|
|
|
|
targets.
|
|
|
|
|
|
|
|
For example, after building OpenFOAM with default MPI settings
|
|
|
|
(eg, system openmpi) using the top-level `Allwmake`, it would be
|
|
|
|
possible to rebuild MPI-layers with different MPI.
|
|
|
|
|
|
|
|
For any given and known type
|
|
|
|
```
|
|
|
|
othermpi()
|
|
|
|
{
|
|
|
|
export WM_MPLIB=OPENMPI
|
|
|
|
export FOAM_MPI=openmpi-3.1.3
|
|
|
|
|
|
|
|
export OPAL_PREFIX=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
|
|
|
|
export MPI_ARCH_PATH="$OPAL_PREFIX"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
And use this to rebuild ThirdParty ptscotch:
|
|
|
|
```
|
|
|
|
(
|
|
|
|
othermpi
|
|
|
|
$WM_THIRD_PARTY_DIR/makeSCOTCH
|
|
|
|
)
|
|
|
|
```
|
|
|
|
and rebuild the mpi-dependent parts of OpenFOAM.
|
|
|
|
It is also possible to provide an out-of-source install location, for
|
|
|
|
example, when using an existing docker/signularity image to rebuild new
|
|
|
|
MPI-components:
|
|
|
|
```
|
|
|
|
for script in $(find src -name Allwmake-mpi)
|
|
|
|
do
|
|
|
|
(
|
|
|
|
other_mpi
|
|
|
|
export FOAM_MPI_LIBBIN="$HOME/tmp/install-prefix/lib/$FOAM_MPI"
|
|
|
|
)
|
|
|
|
done
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Arbitrary installation locations for building modules
|
|
|
|
|
|
|
|
When compiling additional modules or user code, we need more control
|
|
|
|
for the installation locations beyond the usual `FOAM_USER_LIBBIN`,
|
|
|
|
`FOAM_SITE_LIBBIN`, `FOAM_LIBBIN`, and wish to have these values be
|
|
|
|
modifiable without editing files.
|
|
|
|
|
|
|
|
This is now handled by providing wmake rules for handling standard defaults:
|
|
|
|
- *GENERAL_RULES*/`module-path-user`
|
|
|
|
- *GENERAL_RULES*/`module-path-group`
|
|
|
|
- *GENERAL_RULES*/`module-path-project`
|
|
|
|
|
|
|
|
which are incorporated as follows:
|
|
|
|
|
|
|
|
The `Make/options`
|
|
|
|
```
|
|
|
|
include $(GENERAL_RULES)/module-path-user
|
|
|
|
```
|
|
|
|
|
|
|
|
The `Make/files`
|
|
|
|
```
|
|
|
|
LIB = $(FOAM_MODULE_LIBBIN)/libMyLibrary
|
|
|
|
```
|
|
|
|
|
|
|
|
By default these would compile into FOAM_USER_{APPBIN,LIBBIN} but
|
|
|
|
could be adjusted at compilation time. For example,
|
|
|
|
```
|
|
|
|
wmake -module-prefix=/path/my-install-location
|
|
|
|
```
|
|
|
|
Or
|
|
|
|
```
|
|
|
|
./Allwmake -module-prefix=/path/my-install-location
|
|
|
|
./Allwmake -prefix=/path/my-install-location
|
|
|
|
```
|
|
|
|
Or
|
|
|
|
```
|
|
|
|
FOAM_MODULE_PREFIX=/path/my-install-location ./Allwmake
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Input Dictionaries
|
|
|
|
|
|
|
|
|
|
|
|
### Atmospheric models
|
|
|
|
|
|
|
|
The models provided under `$FOAM_SRC/atmosphericModels/` can now only be used by explicitly adding the `atmosphericModels` library name into the `$FOAM_CASE/system/controlDict` file as follows:
|
|
|
|
|
|
|
|
```
|
|
|
|
// Make sure all utilities know specialised models
|
|
|
|
libs (atmosphericModels);
|
|
|
|
```
|
|
|
|
|
|
|
|
Please see `$FOAM_TUTORIALS/verificationAndValidation/atmosphericModels/HargreavesWright_2007/system/controlDict` for an example.
|
|
|
|
|
|
|
|
|
|
|
|
### Boundary condition: turbulentDigitalFilterInlet
|
|
|
|
|
|
|
|
The boundary condition setup for [turbulentDigitalFilterInlet](https://develop.openfoam.com/Development/openfoam/-/blob/develop/src/finiteVolume/fields/fvPatchFields/derived/turbulentDigitalFilterInlet/turbulentDigitalFilterInletFvPatchVectorField.H) was modified to a considerable extent without providing backward compatibility for the setup (not the output).
|
|
|
|
|
|
|
|
Please see [$FOAM_TUTORIALS/verificationAndValidation/turbulentInflow/PCF/0.orig/inlet.DFM/U](https://develop.openfoam.com/Development/openfoam/-/tree/develop/tutorials/verificationAndValidation/turbulentInflow/PCF/0.orig/inlet.DFM) for an example of the new setup.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## blockMesh
|
|
|
|
|
|
|
|
Use topological merge as default for blockMesh instead of the previous
|
|
|
|
merging by point locations. The topological merge is _faster_ and works
|
|
|
|
better for high aspect ratio meshes. For the occasional meshes where
|
|
|
|
point-based merging is preferrable, `mergeType points;` can be added
|
|
|
|
to the `blockMeshDict` or `blockMesh -merge-points` specified at the
|
|
|
|
command-line.
|
|
|
|
|
|
|
|
New blockMesh `-write-vtk` option that generates a `blockTopology.vtu`
|
|
|
|
file (VTK ASCII, XML) that can be loaded and inspected in paraview.
|
|
|
|
|
|
|
|
This file contains more information than the equivalent obj file
|
|
|
|
(generated with the `-write-obj` option, formerly `-blockTopology`)
|
|
|
|
since it includes connectivity, cell shapes and cell IDs (equivalent
|
|
|
|
to the block numbers).
|
|
|
|
|
|
|
|
|
|
|
|
[code-patterns]: /coding/patterns/patterns
|
|
|
|
[upgrade-guide]: /upgrade/upgrade
|
|
|
|
|
|
|
|
[v2006-notes]: https://www.openfoam.com/releases/openfoam-v2006/ |