openfoam merge requestshttps://develop.openfoam.com/Development/openfoam/-/merge_requests2020-06-24T21:12:39Zhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/367AMI code enhancements2020-06-24T21:12:39ZAndrew HeatherAMI code enhancements### Summary
**Note: this is beta-level code and will receive further updates in future releases**
This change set includes:
- New option for `cyclicAMI` and `cyclicACMI` patches to perform topological updates to enforce a 1-to-1 m...### Summary
**Note: this is beta-level code and will receive further updates in future releases**
This change set includes:
- New option for `cyclicAMI` and `cyclicACMI` patches to perform topological updates to enforce a 1-to-1 match between source and target patches to ensure conservation across AMI patches and greatly reduced pressure field perturbations. Changes based on ref [1]
- Deprecated `directAMI`; replaced by `nearestFaceAMI`
- Significant code refactoring
### Resolved bugs (If applicable)
- General AMI conservation issues/noisy pressure predictions
### Details of new models (If applicable)
- Backwards compatibility [should be] maintained
- New topological changes triggered by using a special mesh motion solver: `dynamicFvMesh dynamicMotionSolverFvMeshAMI;`
- this may be absorbed into the 'standard' `dynamicMotionSolverFvMesh` model in future releases
- Test case: [mixerVesselAMI2D_with-boundary-layers.tgz](/uploads/4ca838c78e139007cb6f2f06026bdf07/mixerVesselAMI2D_with-boundary-layers.tgz)
| dynamicMotionSolverFvMesh | dynamicMotionSolverFvMeshAMI |
| ------ | ------ |
| ![plot](/uploads/37f8e095ad01c8c10dcdb9ab40ffa74c/plot.png) v2006| ![plot](/uploads/ad90049926e774bd3127256f86f0e075/plot.png) v2006|
| ![plot](/uploads/7a0930907ab64ac5941c6bcf781e17ba/plot.png) v1912| |
Note: since the AMI code triggers topological updates, to reconstruct parallel cases:
- use `reconstructParMesh` to reconstruct the mesh at each time, followed by `reconstructPar` to reconstruct the fields; or
- use `redistributePar -reconstruct` to reconstruct both mesh and fields (in parallel)
- Code refactoring has enabled greater control of the AMI; the AMIMethod can now be set in the `polyMesh/boundary` file, e.g.
```
AMI2
{
type cyclicAMI;
inGroups 1(cyclicAMI);
nFaces 96;
startFace 6336;
matchTolerance 0.0001;
transform noOrdering;
neighbourPatch AMI1;
// New optional entries
AMIMethod faceAreaWeightAMI;
restartUncoveredSourceFace 1;
}
```
### Deprecations
The `directAMI` method has been deprecated and replaced by the faster and more robust, new `nearestFaceAMI` method. The new method creates a 1-to-1 mapping based on the nearest face.
### Risks
- Significant change to AMI code
- Not only affects cyclic patches, but other areas of the code that make use of the tooling, e.g.:
- mapped patches
- mapFieldsPar
- region models (film modelling)
- mapping function objects
### Known issues/to check
When using `dynamicMotionSolverFvMeshAMI`
- restart behaviour not currently available
### Tests
Checked on the following cases:
- pimpleFoam/laminar/mixerVesselAMI2D
- pimpleFoam/RAS/oscillatingInletACMI2D
- XiDyMFoam/annularCombustorTurbine
- {customer turbo machinery}
For each, the `dynamicMotionSolverFvMesh` option recovers v1912 behaviour
### References
[1] H.J. Aguerre, S. Márquez Damián J.M. Gimenez, N.M.Nigro, *Conservative handling of arbitrary non-conformal interfaces using an efficient supermesh*, Journal of Computational Physics 335(15)21-49. 2017. https://doi.org/10.1016/j.jcp.2017.01.018
### Acknowledgements
- Many thanks to Horacio Aguerre @aguerrehoracio and Santiago Márquez @santiagomarquezd for bringing the methodology to our attention and for many useful discussions and testing throughout these developments.v2006https://develop.openfoam.com/Development/openfoam/-/merge_requests/364ENH: Miscellaneous enhancement/features and bug fixes2020-06-11T12:30:36ZKutalmış BerçinENH: Miscellaneous enhancement/features and bug fixesv2006Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/363ENH: New atmospheric boundary layer (ABL) model suite (Part 1)2020-06-09T10:09:12ZKutalmış BerçinENH: New atmospheric boundary layer (ABL) model suite (Part 1)### Summary
This commit is the first main commit of a collaborative work between `OpenCFD Ltd.`-`ENERCON Gmbh`-`CENER`, for which there will be another comprehensive commit in the next release (may include SOWFA-6 - [see](https://gith...### Summary
This commit is the first main commit of a collaborative work between `OpenCFD Ltd.`-`ENERCON Gmbh`-`CENER`, for which there will be another comprehensive commit in the next release (may include SOWFA-6 - [see](https://github.com/NREL/SOWFA-6/issues/11) for exchange of ideas).
With this commit, OpenFOAM learns:
- How to comprehensively model (RANS) surface and Ekman atmosphere layers under (slightly/very) stable/unstable/neutral atmospheric stability conditions over spatiotemporal-variant terrain (e.g. partially forestry plain).
### Details
Please refer to the header file documentation for complete set of details.
- 8 new `fvOption`s that are usable with epsilon/omega-based RANS closure models:
- atmAmbientTurbSource
- atmBuoyancyTurbSource
- atmCoriolisUSource
- atmLengthScaleTurbSource
- atmPlantCanopyTurbSource
- atmPlantCanopyUSource
- atmPlantCanopyTSource
- atmNutSource
- 7 new `wall function`s shipped with `PatchFunction1` and `TimeFunction1` support for the input entries:
- atmAlphatkWallFunction
- atmEpsilonWallFunction
- atmNutkWallFunction
- atmNutUWallFunction
- atmNutWallFunction
- atmOmegaWallFunction
- atmTurbulentHeatFluxTemperature
- A new function object to quantify the [Obukhov length](http://glossary.ametsoc.org/wiki/Obukhov_length#:~:text=Obukhov%20length,consumption%20of%20turbulence%20kinetic%20energy.):
- ObukhovLength
- 3 new tutorials involving `buoyantBoussinesqSimpleFoam` verifications in comparison to field measurements:
- `verificationAndValidation/atmosphericFlows/atmFlatTerrain`
- verification with the `Leipzig` field experiment
- illustration of precursor/successor field mapping
- `verificationAndValidation/atmosphericFlows/atmForestStability`
- verification with the Sweden field experiment
- 2 new actuator disk modelling approaches in the existing `actuationDiskSource` wherein the incoming velocity measurements can now be held by using `topoSet`s.
### Resolved bugs (If applicable)
None.
### Verifications
The model suite was verified for `neutral stability` by the `Leipzig` experiment for which all the details can be found in, and can be reproduced by `verificationAndValidation/atmosphericFlows/atmFlatTerrain`
`buoyantBoussinesqSimpleFoam-kEpsilon`:
<img src="/uploads/96349ecee9d1561d196795b266d22cdd/u-z.png" width="250" height="500">
<img src="/uploads/146d8921d130e210f27b21f1c8a902ce/v-z.png" width="250" height="500">
`buoyantBoussinesqSimpleFoam-kOmegaSST`:
<img src="/uploads/aead7fafb086e2d918302d45660e8e61/u-z.png" width="250" height="500">
<img src="/uploads/bca10f4506b06986ed47c2114e9c43ad/v-z.png" width="250" height="500">
In addition, the model suite was verified for all spectrum of stability conditions with forestry ground by the `Sweden(?)` experiment for which all the details can be found in, and can be reproduced by `verificationAndValidation/atmosphericFlows/atmForestStability`
`buoyantBoussinesqSimpleFoam-kEpsilon` (wind speed, turbulent kinetic energy, and wind veer profiles, respectively):
<img src="/uploads/370aca91fc19f2fbb719ce4655ad4618/uNorm-zNorm.png" width="600" height="500">
<img src="/uploads/e024e77ee5460299774ccaeff9e360c5/kNorm-zNorm.png" width="600" height="500">
<img src="/uploads/d292e5901e01dbb0bc517d9c76be79b2/veer-zNorm.png" width="600" height="500">
with the Obukhov lengths:
veryStable = 44.7979
stable = 300.723
slightlyStable = 859.962
neutral = undefined
slightlyUnstable = -547.088
unstable = -265.992
`buoyantBoussinesqSimpleFoam-kOmegaSST` (wind speed, turbulent kinetic energy, and wind veer profiles, respectively):
<img src="/uploads/4e19e3e02e97044e8d2dda9e718e2e32/uNorm-zNorm.png" width="600" height="500">
<img src="/uploads/8803c8bbe63de1ac2015310615521fa2/kNorm-zNorm.png" width="600" height="500">
<img src="/uploads/c938b5ae2d5fd19e5116bd00b910809a/veer-zNorm.png" width="600" height="500">
with the Obukhov lengths:
veryStable = 67.5555
stable = 396.562
slightlyStable = 1147.69
neutral = undefined
slightlyUnstable = -707.885
unstable = -319.368
Furthermore, the persistence of atmospheric boundary layer inlet profiles downstream were quantified in comparison to the profiles near the outlet, and it was found out that the overall discrepancy is within 2%:
(wind speed, turbulent kinetic energy, turbulence intensity, and temperature horizontal profiles, respectively)
<img src="/uploads/e01e5f6429cb054adda7bddc649d4348/Horizontal_MagU.png" width="600" height="500">
<img src="/uploads/78472b8205b8c79a611793a9b0a6933a/Horizontal_k.png" width="600" height="500">
<img src="/uploads/f001568734ac5b398018ba1fd5349aa2/Horizontal_TI.png" width="600" height="500">
<img src="/uploads/21eaa5b3ec305eacb8f2af11c0226985/Horizontal_T.png" width="600" height="500">
### Risks
- **User input change:** `nutkAtmRoughWallFunction` is renamed without extra support to `atmNutkWallFunction` (ensured the bitwise regression)
- Since the majority of the utilities above are new, the potential effects on the existing utilities would only be unexpected.
v2006Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/354ENH: Improve and verify atmBoundaryLayerInlet conditions2020-06-05T13:42:24ZKutalmış BerçinENH: Improve and verify atmBoundaryLayerInlet conditions### Summary
- Related to the log-law type ground-normal inflow boundary conditions for
wind velocity and turbulence quantities for homogeneous, two-dimensional,
dry-air, equilibrium and neutral atmospheric boundary layer (ABL) m...### Summary
- Related to the log-law type ground-normal inflow boundary conditions for
wind velocity and turbulence quantities for homogeneous, two-dimensional,
dry-air, equilibrium and neutral atmospheric boundary layer (ABL) modelling
- ENH: Generalises Richards-Hoxey expressions. This allows to input experimental profiles or heuristic spatial-variant profiles in a mathematically consistent way.
Yang, Y., Gu, M., Chen, S., & Jin, X. (2009).
New inflow boundary conditions for modelling the neutral equilibrium
atmospheric boundary layer in computational wind engineering.
J. of Wind Engineering and Industrial Aerodynamics, 97(2), 88-95.
DOI:10.1016/j.jweia.2008.12.001
- ENH: Adds new generalised `atmBoundaryLayerInletOmega` boundary condition by using:
Yang, Y., Gu, M., & Jin, X., (2009).
New inflow boundary conditions for modelling the
neutral equilibrium atmospheric boundary layer in SST k-ω model.
In: The Seventh Asia-Pacific Conference on Wind Engineering,
November 8-12, Taipei, Taiwan.
- ENH: Adds new verification case `tutorials/verificationAndValidation/atmosphericFlows/HargreavesWright_2007` by using:
Rectangular prism shown in FIG 1 of
Hargreaves, D. M., & Wright, N. G. (2007).
On the use of the k–ε model in commercial CFD software
to model the neutral atmospheric boundary layer.
Journal of wind engineering and
industrial aerodynamics, 95(5), 355-369.
DOI:10.1016/j.jweia.2006.08.002
Benchmark data:
HW, 2007 FIG 6
- BUG: Fixes value-entry behaviour in `atmBoundaryLayerInlet` (fixes #1578) (Thanks to @perjorgensen for the bug report).
- Without this change:
- for serial-parallel computations, if `value` entry is available in
an `atmBoundaryLayerInlet` BC, the theoretical ABL profile expressions
are not computed, and the `value` entry content is used as a profile data
- for parallel computations, if `value` entry is not available, `decomposePar`
could not be executed.
- With this change:
- assuming `value` entry is always be present, the use of `value` entry for
the ABL profile specification is determined by a flag `initABL`
- the default value of the optional flag `initABL` is `true`, but whenever
`initABL=true` is executed, `initABL` is overwritten as `false` for the
subsequent runs, so that `value` entry can be safely used.
- BUG: Ensures `atmBoundaryInlet` conditions are Galilean-invariant (fixes #1692)
- DOC: Improves `atmBoundaryLayerInlet` header documentation
### Resolved bugs (If applicable)
#1578
#1692
### Details of new models (If applicable)
##### kEpsilon-parallelHierarchical8-Gcc74DP:
![Ux_upstream](/uploads/8586589de26be6cbf33602f420b1872d/Ux_upstream.png)
![Ux_mid](/uploads/e89a57641ff4799d90e60b760bac2cb8/Ux_mid.png)
![Ux_downstream](/uploads/5227ff27d82ad807ed12b216f4d8d87e/Ux_downstream.png)
![epsilon](/uploads/75d3f250399b9ecd27ccab11f424299c/epsilon.png)
![k](/uploads/9796779be6eebebdc8ac92ec22e3335f/k.png)
##### kOmegaSST-parallelHierarchical8-Gcc74DP:
![Ux_upstream](/uploads/4a7d7c94ea8b5a3147b16d0b05013be4/Ux_upstream.png)
![Ux_mid](/uploads/be83cc10455335ae3c85f9237fc1e489/Ux_mid.png)
![Ux_downstream](/uploads/1f31d8d2ef9872f4be0ac0dba5e8234b/Ux_downstream.png)
![k](/uploads/ecbebd53a4c6614877dece10e61f2a71/k.png)
![omega](/uploads/0420c6c1d4637f756d92992b7f884568/omega.png)
### Risks
##### Regression
Bitwise regression is preserved.
##### Changes to user input
- `zGround` is silently deprecated, and its functionality is now inherently computed.
- `d` is introduced for `displacement height`.
- ~~`Uref` and `Zref` are noisily deprecated:~~
- ~~`Uref` is renamed as `uRef` since it refers to a scalar rather than a vector `U`.~~
- ~~`Zref` is renamed as `zRef` since it was always a scalar.~~
### Future work
- These inlet conditions are limited to the surface layer portion of the atmospheric boundary layer:
- Neutral-stratified
- Dry-air
- No Ekman layer
- These inlet conditions can/should be generalised to stable/unstable stratification as well as into the Ekman layer since neutral conditions are **very rare**.
- Spatial variation in input of aerodynamic roughness length, `z0`, and displacement height, `d`.
- Further consistent boundary conditions are required to improve the verification case in terms of `nut` predictions for
- Top boundaries
- Ground boundariesv2006Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/350ENH: New wall-function blending approaches2020-06-17T15:26:52ZKutalmış BerçinENH: New wall-function blending approaches### Summary
This merge request is a discussion placeholder for two topics:
- ~~Potential improvements to the wall-function hierarchies~~
- Wall-function blending treatments between viscous and inertial sublayers
##### ~~Wall-func...### Summary
This merge request is a discussion placeholder for two topics:
- ~~Potential improvements to the wall-function hierarchies~~
- Wall-function blending treatments between viscous and inertial sublayers
##### ~~Wall-function hierarchy~~
~~Arguably, the wall-function hierarchies need a reexamination as the relations have "grown organically" in the course of time. One recent problem is that `{omega,epsilon,k}Wall` functions use data members from `nutWallFunction` base class even though the former group is not derived from the latter.~~
~~One practical consequence is that `{omega,epsilon,k}Wall` always require a `nut` wall function is defined in the `nut` dictionary, otherwise simulation in question noisily fails without informing the user with useful information, e.g. [CFD-Online:Error with k-omega SST and simpleFoam (21-Feb-20)](https://www.cfd-online.com/Forums/openfoam-solving/224476-error-k-omega-sst-simplefoam.html), and the bug-fix:55776069975061c488a6294a5e81a7a92b04db45.~~
##### Wall-blending treatments
- Four wall-function blending treatments were introduced:
- `STEPWISE`
- `MAX`
- `BINOMIAL`
- `EXPONENTIAL`
- .. For the following wall functions:
- `epsilonWallFunction`
- `omegaWallFunction`
- `nut{k,U}WallFunction`
- The header-file documentations were improved for the following wall functions for which the blending treatments were not applicable (e.g. due to the continuous treatment in `nutUSpaldingWallFunction`):
- `nutU{Spalding,Tabulated,Blended}WallFunction`
- `nut{k,U}RoughWallFunction`
- `nutLowReWallFunction`
- `{kLowRe,kqR}WallFunction`
- Based on:
- Viegas and Rubesin (1983); Viegas et al. (1985) (i.e. the option: `STEPWISE`)
- Menter and Esch (2001) (i.e. the option: `BINOMIAL`)
- Popovac and Hanjalić (2007) (i.e. the options: `MAX`, `EXPONENTIAL`)
- Knopp et al. (2006) (i.e. the option: `TANH` only for `omega`)
### Resolved bugs
N/A
### Risks
High risk, yet bitwise backward compatibility, and regression were verified for each modified functionality.
@mark @Sergio @Mattijs v2006Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/331Submodule visualization2020-01-23T14:24:33ZMark OLESENSubmodule visualizationThis finalises the work done to collect visualization-related items:
- catalyst
- paraview-plugins
- runTimePostProcessing
into a single place.
- Makes it easier to make related code changes.
- Makes it easier to mix and match differen...This finalises the work done to collect visualization-related items:
- catalyst
- paraview-plugins
- runTimePostProcessing
into a single place.
- Makes it easier to make related code changes.
- Makes it easier to mix and match different combinations of VTK/ParaView versions and capabilities (Eg, MESA, MPI etc).
Replaces the standalone catalyst submodule.Andrew 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/305ENH|BUG: Misc2019-12-12T11:30:37ZKutalmış BerçinENH|BUG: MiscAndrew HeatherAndrew Heatherhttps://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/107Updated random numbers2017-04-28T09:11:19ZAdminUpdated random numbersPreviously there were 2 random number generator classes - `Random` and `cachedRandom`. These have been consolidated by:
- removing/deprecating the `Random` class
- renaming the `cachedRandom` class to `Random`
The `Random` class no...Previously there were 2 random number generator classes - `Random` and `cachedRandom`. These have been consolidated by:
- removing/deprecating the `Random` class
- renaming the `cachedRandom` class to `Random`
The `Random` class now stores its own buffer and uses the re-entrant system random functions so that each instantiation is not affected by each call to (re-)initialise the random number seed. The caching of the random numbers is not required since the generator can be reset using the same initial seed.Version v1706https://develop.openfoam.com/Development/openfoam/-/merge_requests/213Feature vtm/vtk2018-11-26T10:30:41ZMark OLESENFeature vtm/vtkIncludes numerous modifications to the VTK-related infrastructure. Notably it adds parallel output for foamToVTK and for the vtkWrite function object. Multi-region, multi-block VTM output with associated time-series files. TimeValue time...Includes numerous modifications to the VTK-related infrastructure. Notably it adds parallel output for foamToVTK and for the vtkWrite function object. Multi-region, multi-block VTM output with associated time-series files. TimeValue time-stamps within all the generated files. Improvements to the vtkCloud and vtkWrite function objects to allow selection of regions of interest.v1812Mark OLESENMark OLESENhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/200ENH: new bitSet class and improved PackedList class (closes #751)2018-04-25T10:40:00ZMark OLESENENH: new bitSet class and improved PackedList class (closes #751)- The bitSet class replaces the old PackedBoolList class.
The redesign provides better block-wise access and reduced method
calls. This helps both in cases where the bitSet may be relatively
sparse, and in cases where advantage ...- The bitSet class replaces the old PackedBoolList class.
The redesign provides better block-wise access and reduced method
calls. This helps both in cases where the bitSet may be relatively
sparse, and in cases where advantage of contiguous operations can be
made. This makes it easier to work with a bitSet as top-level object.
In addition to the previously available count() method to determine
if a bitSet is being used, now have simpler queries:
- all() - true if all bits in the addressable range are empty
- any() - true if any bits are set at all.
- none() - true if no bits are set.
These are faster than count() and allow early termination.
The new test() method tests the value of a single bit position and
returns a bool without any ambiguity caused by the return type
(like the get() method), nor the const/non-const access (like
operator[] has). The name corresponds to what std::bitset uses.
The new find_first(), find_last(), find_next() methods provide a faster
means of searching for bits that are set.
This can be especially useful when using a bitSet to control an
conditional:
OLD (with macro):
forAll(selected, celli)
{
if (selected[celli])
{
sumVol += mesh_.cellVolumes()[celli];
}
}
NEW (with const_iterator):
for (const label celli : selected)
{
sumVol += mesh_.cellVolumes()[celli];
}
or manually
for
(
label celli = selected.find_first();
celli != -1;
celli = selected.find_next()
)
{
sumVol += mesh_.cellVolumes()[celli];
}
- When marking up contiguous parts of a bitset, an interval can be
represented more efficiently as a labelRange of start/size.
For example,
OLD:
if (isA<processorPolyPatch>(pp))
{
forAll(pp, i)
{
ignoreFaces.set(i);
}
}
NEW:
if (isA<processorPolyPatch>(pp))
{
ignoreFaces.set(pp.range());
}
v1806AdminAdminhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/104Initial attempt to track oriented surface fields2017-05-24T13:30:52ZAdminInitial attempt to track oriented surface fieldsThese changes are an attempt to cleanly identify oriented surface fields, i.e. those where the value is signed according to the owner->neighbour direction e.g. the face flux.
Still to do:
* [x] propagate through field mapping - read...These changes are an attempt to cleanly identify oriented surface fields, i.e. those where the value is signed according to the owner->neighbour direction e.g. the face flux.
Still to do:
* [x] propagate through field mapping - ready to test
* [x] simplify surfaceFieldValue function object - passed tests
* [x] check other uses, .e.g. AMI?
* [x] clean-up of dev statements
Checks
* [x] rhoCentral[DyM]Foam solvers
@MattijsVersion v1706AdminAdminhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/61WIP: ENH: runTimePostProcessing - added option to clear/remove objects after use2016-12-15T15:52:25ZAdminWIP: ENH: runTimePostProcessing - added option to clear/remove objects after useWhen specifying line and surface function-object-based visualisation, use the optional 'clearObjects' flag to indicate that source objects should be removed/cleared after use.
Test case: [cavity.tgz](/uploads/742a7620da483538fecee15e2ca...When specifying line and surface function-object-based visualisation, use the optional 'clearObjects' flag to indicate that source objects should be removed/cleared after use.
Test case: [cavity.tgz](/uploads/742a7620da483538fecee15e2ca79e32/cavity.tgz)
Syntax:
```
surfaces
{
cuttingPlane1
{
type functionObject;
functionObject cuttingPlane;
clearObjects yes; // new option
...
```
Note: only files that have been used will be removed, e.g. if a function object has created multiple surface files, unused files will remain at the end of the run - in the attached case the p surface remains...Version v1612AdminAdminhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/75Feature keep sampled pids2016-11-09T14:58:43ZMark OLESENFeature keep sampled pidsRebased version of merge request !58, following ticket closure for issue #104 .Rebased version of merge request !58, following ticket closure for issue #104 .Version v1612Mark OLESENMark OLESENhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/77Surface declutter - issue #2942016-11-14T12:43:40ZMark OLESENSurface declutter - issue #294Removing various clutter from surfMesh and triSurface
- unused classes/files (backup copies on non-release repo)
- relocate some triSurface-related classes to where they make more sense, and where they can be reused.
- improve handlin...Removing various clutter from surfMesh and triSurface
- unused classes/files (backup copies on non-release repo)
- relocate some triSurface-related classes to where they make more sense, and where they can be reused.
- improve handling of various face types in MeshedSurface and UnsortedMeshedSurface (to bridge the gap to triSurface)
- improve transfer methods for reclaiming/reusing surface allocationsVersion v1612Mark OLESENMark OLESEN