openfoam merge requestshttps://develop.openfoam.com/Development/openfoam/-/merge_requests2019-12-18T13:59:42Zhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/317Feature ihc wavemodels2019-12-18T13:59:42ZAndrew HeatherFeature ihc wavemodelsUpdated `waveMaker` boundary conditions for v1912 release - now possible to supply paddle information to generate 3-D waves.
Contribution from @barjasg at IH Cantabria; integration by OpenCFDUpdated `waveMaker` boundary conditions for v1912 release - now possible to supply paddle information to generate 3-D waves.
Contribution from @barjasg at IH Cantabria; integration by OpenCFDv1912Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/316New VOF multiphaseStabilizedTurbulence fvOption2019-12-19T08:46:51ZAndrew HeatherNew VOF multiphaseStabilizedTurbulence fvOption### Summary
Applies corrections to turbulence kinetic energy equation and turbulence viscosity field for incompressible multiphase flow cases.
Turbulence kinetic energy is over-predicted in incompressible VOF solvers at the phase i...### Summary
Applies corrections to turbulence kinetic energy equation and turbulence viscosity field for incompressible multiphase flow cases.
Turbulence kinetic energy is over-predicted in incompressible VOF solvers at the phase interface and throughout the water column in nearly-potential flow regions beneath surface waves.
This fvOption applies corrections based on the references:
Buoyancy source term in turbulence kinetic energy equation:
Devolder, B., Rauwoens, P., and Troch, P. (2017).
Application of a buoyancy-modified k-w SST turbulence model to
simulate wave run-up around a monopile subjected to regular waves
using OpenFOAM.
Coastal Engineering, 125, 81-94.
Correction to turbulence viscosity:
Larsen, B.E. and Fuhrman, D.R. (2018).
On the over-production of turbulence beneath surface waves in
Reynolds-averaged Navier-Stokes models
J. Fluid Mech, 853, 419-460
### Resolved bugs (If applicable)
See #1433
### Details of new models (If applicable)
The implementation is based on the form for the k-epsilon turbulence model.
Example usage:
multiphaseStabilizedTurbulence1
{
type multiphaseStabilizedTurbulence;
active yes;
multiphaseStabilizedTurbulenceCoeffs
{
// Optional coefficients
lambda2 0.1; // A value of 0 sets the nut correction to 0
Cmu 0.09; // from k-epsilon model
C 1.51; // model coefficient from k-omega model
alpha 1.36; // 1/Prt
}
}
The model `C` coefficient for the k-epsilon model equates to C2/C1 = 1.33; the (default) value of 1.51 comes from the k-omega model and is more conservative.
### Risks
Modular - low risk
### Credits
Thanks go to the Turbulence Technical Committee, and the useful discussions with and code testing by Bjarke Eltard-Larsen and David Fuhrman (Technical University of Denmark).v1912https://develop.openfoam.com/Development/openfoam/-/merge_requests/314ENH: Adjoint optimisation fixes2019-12-17T19:57:30ZVaggelis PapoutsisENH: Adjoint optimisation fixesA number of bug fixes and enhancements that didn't find their way to the main adjointOptimisation pushA number of bug fixes and enhancements that didn't find their way to the main adjointOptimisation pushv1912Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/312INT: openfoam.org code integration2019-12-24T07:36:41ZSergio FerrarisINT: openfoam.org code integration1) rPolynomial Eq of State
2) externalForce and softWall in rigidBodyDynamics
INT: Several minor bug fixes1) rPolynomial Eq of State
2) externalForce and softWall in rigidBodyDynamics
INT: Several minor bug fixesv1912Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/306Feature mesh update controls2019-12-12T11:03:03ZAndrew HeatherFeature mesh update controls### Summary
Adds a new update function to `dynamicFvMesh` that enables users to control how often the mesh is updated for moving mesh cases.
### Details of new models (If applicable)
Adds a `timeControl` object to `dynamicFvMesh`, i....### Summary
Adds a new update function to `dynamicFvMesh` that enables users to control how often the mesh is updated for moving mesh cases.
### Details of new models (If applicable)
Adds a `timeControl` object to `dynamicFvMesh`, i.e. the same controls as used by function objects. This requires the top-level solver to call the new
mesh.controlledUpdate();
function instead of
mesh.update();
Currently applied to `pimpleFoam` and `rhoPimpleFoam` only for beta testing, and likely to be rolled out across other solvers in future releases.
Example usage in the `dynamicMeshDict`
updateControl timeStep;
updateInterval 5;
### Risks
Only applied to the solvers mentioned above (for now) - testing has not shown any regressions.v1912Mark OLESENMark OLESENhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/304ENH: Added new limitFields function object2019-12-13T20:04:07ZAndrew HeatherENH: Added new limitFields function object@roger @prashant - can you confirm this OK to go in? and any test case/updated tutorial that can be provided?
---
# Details of the new function object:
Limits fields to user-specified min and max bounds
Usage
Example of func...@roger @prashant - can you confirm this OK to go in? and any test case/updated tutorial that can be provided?
---
# Details of the new function object:
Limits fields to user-specified min and max bounds
Usage
Example of function object specification:
limitFields1
{
type limitFields;
libs ("libfieldFunctionObjects.so");
...
fields (U);
limit max;
max 100;
}
Where the entries comprise:
Property | Description | Required | Default value
type | type name: limitFields | yes |
fields | list of fields to process | yes |
limit | bound to limit - see below | yes |
The limit entry can take the value:
- min : specify a minimum value
- max : specify a maximum value
- both : specify a minimum value and a maximum valuev1912Mark OLESENMark OLESENhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/303ENH: Added new function object to compute the Proudman acoustic power2019-12-13T20:04:27ZAndrew HeatherENH: Added new function object to compute the Proudman acoustic power@Roger @Prashant - can you confirm this OK to go in? and any test case/updated tutorial that can be provided?
---
# Details of the new function object:
Calculates the acoustic power due to the volume of isotropic turbulence
usi...@Roger @Prashant - can you confirm this OK to go in? and any test case/updated tutorial that can be provided?
---
# Details of the new function object:
Calculates the acoustic power due to the volume of isotropic turbulence
using Proudman's formula
The acoustic power P_A [W/m3] in terms of turbulence k and \epsilon is given as:
P_A = alpha_\epsilon \rho \epsilon M_t^5
where alpha_\epsilon is a constant (0.1) and
M_t = \frac{\sqrt{2 k}}{a_0}
with a_0 the speed of sound. The acoustic power is also output in
dB using:
L_P = 10 \log \frac{P_A}{P_ref}
where P_ref is a constant (1e-12 W/m3)
Usage
Example of function object specification to calculate the Proudman acoustic
power
proudmanAcousticPower1
{
type proudmanAcousticPower;
libs ("libfieldFunctionObjects.so");
...
// Required additional entries for incompressible calculations
rhoInf 1.225;
aRef 340;
}
Where the entries comprise:
Property | Description | Required | Default value
type | type name: proudmanAcousticPower | yes |
rhoInf | Freestream density for incompressible cases | no |
aRef | Reference spped of sound for incompressible cases | no |
alphaEps | Model coefficient | no | 0.1
Note
- The freestream density and reference speed of sound are only necessary
when a thermodynamics package is unavailable, typically for incompressible
cases.v1912Mark OLESENMark OLESENhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/302ENH: Added new scaledFixedValue boundary condition2019-12-11T10:45:32ZAndrew HeatherENH: Added new scaledFixedValue boundary conditionAdds new `scaledFixedValue` boundary condition
This condition applies a scalar multiplier to the value of another
boundary condition.
Usage
Property | Description | Required | Default value
scale ...Adds new `scaledFixedValue` boundary condition
This condition applies a scalar multiplier to the value of another
boundary condition.
Usage
Property | Description | Required | Default value
scale | Time varing scale | yes |
patch | patchField providing the raw patch value | yes |
Example of the boundary condition specification to scale a reference
velocity of (15 0 0) supplied as a fixedValue by a table of values
that ramps the scale from 0 to 1 over 1 second:
```
<patchName>
{
type scaledFixedValue;
scale table
(
( 0 0)
( 1.0 1.0)
(100.0 1.0)
);
patch
{
type fixedValue;
value uniform (15 0 0);
}
}
```v1912Mattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comMattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/301Feature particle patch postpro filtering2019-12-10T15:53:15ZAndrew HeatherFeature particle patch postpro filtering### Summary
Adds options to write particle-patch interactions to file, and to select particle fields to post-process for the `patchPostProcessing` cloud function object
### Resolved bugs (If applicable)
none
### Details of new mode...### Summary
Adds options to write particle-patch interactions to file, and to select particle fields to post-process for the `patchPostProcessing` cloud function object
### Resolved bugs (If applicable)
none
### Details of new models (If applicable)
Cloud patch interaction models:
Optionally write patch interaction statistics, e.g. number and mass of particles that stick, escape etc. to file using the optional `writeToFile` entry, e.g.
```
localInteractionCoeffs
{
patches
(
"(walls|cyc.*)"
{
type rebound;
}
"inlet|outlet"
{
type escape;
}
);
// New optional entry
writeToFile yes;
}
```
Cloud function objects:
New `fields` optional entry can be used to select which particle fields to post-process; if empty or the entry is not given all fields are written (to provide backwards compatibility)
```
patchPostProcessing1
{
type patchPostProcessing;
// Optional new entry
fields (position "U.*" d T nParticle);
maxStoredParcels 20;
patches
(
cycLeft_half0
cycLeft_half1
);
}
```
See the `$FOAM_TUTORIALS/lagrangian/reactingParcelFilm/filter` tutorial for an example
### Risks
Low riskv1912Mark OLESENMark OLESENhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/300Feature expressions2019-12-10T12:10:28ZMark OLESENFeature expressions### Summary
This branch represents an implementation of what is considered to be the most useful aspects of swak4Foam ([Swiss-Army-Knife for FOAM](https://openfoamwiki.net/index.php/Contrib/swak4Foam)) from Bernhard Gschaider, namely ...### Summary
This branch represents an implementation of what is considered to be the most useful aspects of swak4Foam ([Swiss-Army-Knife for FOAM](https://openfoamwiki.net/index.php/Contrib/swak4Foam)) from Bernhard Gschaider, namely the ability to use text-based expressions instead of coding in C++ for the following cases:
- expression-based boundary conditions (also known as _groovy_ boundary conditions)
- expression-based setFields (also known as _funky_ set fields)
The idea of what we currently term *expressions* was pioneered by
(Bernhard Gschaider) and is now firmly established in `swak4Foam`.
Among other things, expressions attempt to bridge the gap between
using standard, predefined boundary conditions and writing dedicated,
special-purpose ones. Although part of this gap is now covered within
OpenFOAM by using dynamically compiled user coding (eg, coded boundary
conditions), there remains substantial areas where it can be
significantly more convenient to have a series of predefined functions
and expression sytax with some access to base OpenFOAM field
functionality that enables rapid deployment of boundary conditions, or
custom-defined `setFields` without writing code.
A significant portion of `swak4Foam` expressions has been adapted for
direct integration into OpenFOAM. During the integration and rewrite,
we have tried to pare things down to a smaller subset with the aim of
covering 90% or more of the common cases. The remaining cases are left
to be reassessed for extending the *expressions* functionality in the
future, but they also may be better served with other approaches (eg,
with coded conditions) that were not available when `swak4Foam` was
originally conceived.
To the greatest extent possible, the integrated *expressions* have
been designed to avoid name clashes with `swak` so it should remain
possible to use the most recent versions of `swak` without problem.
### Risks
- New functionality, so low chance of regression.
- The scope of the functionality will be revised in the future
### Naming (for `swak4Foam` users)
The following are the *expressions* correspondences to `swak`:
- The `exprFixedValue` and `exprGradient` boundary conditions are
roughly equivalent to the _groovy_ boundary conditions.
- The utilities `setExprFields` and `setExprBoundaryFields` are
roughly equivalent to the _funky_ utilities of similar name.
The naming of the boundary conditions and utilities not only reflects
the slightly different input requirements, but simultaneously seeks to
avoid any potential name-clash with `swak4Foam` in a mixed
environment.
The names for the boundary condition dictionary entries tend be
shorter and slightly different (eg, `valueExpr` vs `valueExpression`)
to serve as a small reminder that the *expressions* syntax is slightly
different than the *groovy* equivalents. It also allows the user to
fashion dictionary entries that are sufficient for **both** boundary
condition variants and quickly toggle between them simply by changing
the boundary condition `type`.v1912Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/298Feature zipfields2019-11-18T09:35:31ZMark OLESENFeature zipfieldsAdds _"zip" fields_ function for combining component fields together and _"unzip" fields_ function for splitting a field into its component parts.Adds _"zip" fields_ function for combining component fields together and _"unzip" fields_ function for splitting a field into its component parts.v1912AdminAdminhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/297BUG: adjointSolverName not set correctly in adjointWallVelocityLowRe (fixes #...2019-11-19T11:08:58ZVaggelis PapoutsisBUG: adjointSolverName not set correctly in adjointWallVelocityLowRe (fixes #1502)v1912AdminAdminhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/296BUG: RASModelVariables::SpalartAllmaras cannot be combined with an...2019-11-19T11:09:23ZVaggelis PapoutsisBUG: RASModelVariables::SpalartAllmaras cannot be combined with an...BUG: RASModelVariables::SpalartAllmaras cannot be combined with an fvMotionSolver diffusivity which depends on wall distances (fixes #1501)BUG: RASModelVariables::SpalartAllmaras cannot be combined with an fvMotionSolver diffusivity which depends on wall distances (fixes #1501)v1912AdminAdminhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/284Issue 1454 post process2019-10-17T12:26:30ZAdminIssue 1454 post processUpdated `postProcess` for mesh changes to update the function objects instead of performing a full clear-outUpdated `postProcess` for mesh changes to update the function objects instead of performing a full clear-outv1912AdminAdminhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/273Feature cloud improvements2019-08-06T13:32:03ZMark OLESENFeature cloud improvementsThe main impact of the changes are the addition of nParcels() as a base-level virtual in cloud, which enables quick querying of any derived cloud without the hassle of attempting to cast the regIOobject into any particular `Cloud<Particl...The main impact of the changes are the addition of nParcels() as a base-level virtual in cloud, which enables quick querying of any derived cloud without the hassle of attempting to cast the regIOobject into any particular `Cloud<ParticleType>` type. Similarly, the zero-initialized constructors make it much easier to generate any particle type before filling out with more details and adding to a cloud.v1912AdminAdminhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/272Feature mixed precision2019-08-13T11:07:08ZMark OLESENFeature mixed precisionThis set of changes makes it easier to identify and manage binary reading from different representations. For example, a binary file written from an OpenFOAM installation with WM_SP, WM_LABEL_SIZE=32 can be read back as WM_DP and/or WM_L...This set of changes makes it easier to identify and manage binary reading from different representations. For example, a binary file written from an OpenFOAM installation with WM_SP, WM_LABEL_SIZE=32 can be read back as WM_DP and/or WM_LABEL_SIZE=64. This is managed internally by using the "arch" information that is included in the binary output files. For example,
```
FoamFile
{
version 2.0;
format binary;
class vectorField;
arch "LSB;label=32;scalar=64";
location "constant/polyMesh";
object points;
}
```
On reading, the size information is used to determine if the label/scalar sizes in the file correspond to the *native* version of the currently active OpenFOAM installation. If the values are identical, the binary file reading is as always. If, however, there is a discrepancy between the label/scalar sizes in the file and the current OpenFOAM sizes, the values will be read in the raw format and converted on-the-fly. This adds no additional memory overhead, but can potentially result in somewhat lower reading speeds. There are some additional operations when narrowing the representation (eg, reading in double but saving as float) to avoid underflow and overflow, but it cannot work magic. If your input file has 1e10 faces, the addressing will not fit into a signed or unsigned 32-bit integer.
To manage the reading, the new trait structures `is_contiguous`, `is_contiguous_label`, `is_contiguous_scalar` are used. For data payloads that comprise homogenous base types (ie, the lowest level component is entirely scalar or label) the Detail::readContiguous is used for managing the reading in a uniform manner. For heterogeneous data types, the author of the class must address this individually. This is typically in the following form:
```
if (is.format() == IOstream::ASCII)
{
is >> start_ >> end_ >> level_ >> i_ >> j_ >> k_;
}
else if (!is.checkLabelSize<>() || !is.checkScalarSize<>())
{
// Non-native label or scalar size
is.beginRawRead();
readRawScalar(is, start_.data(), vector::nComponents);
readRawScalar(is, end_.data(), vector::nComponents);
readRawLabel(is, &level_);
readRawLabel(is, &i_);
readRawLabel(is, &j_);
readRawLabel(is, &k_);
is.endRawRead();
}
else
{
is.read
(
reinterpret_cast<char*>(&start_),
sizeofFields_
);
}
```
### Limitation
Changes in the endian type are not handled.v1912AdminAdminhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/265ENH: add PDRsetFields utility2019-12-17T10:07:43ZMark OLESENENH: add PDRsetFields utility- the PDRsetFields utility processes a set of geometrical obstructions
to determine the equivalent blockage effects.
These fields are necessary inputs for PDRFoam calculations.
![simple-cage](/uploads/6782621d04c86e360314258cc...- the PDRsetFields utility processes a set of geometrical obstructions
to determine the equivalent blockage effects.
These fields are necessary inputs for PDRFoam calculations.
![simple-cage](/uploads/6782621d04c86e360314258cc96f3bc0/simple-cage.png)v1912Sergio FerrarisSergio Ferraris