openfoam merge requestshttps://develop.openfoam.com/Development/openfoam/-/merge_requests2016-11-15T09:46:04Zhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/73BUG: resolve some decomposeParDict problems (issues #60, #265).2016-11-15T09:46:04ZMark OLESENBUG: resolve some decomposeParDict problems (issues #60, #265).- Cleanup/centralize handling of -decomposeParDict by relocating
common code into argList. Ensures that all processes receive
identical information about the -decomposeParDict opton.
- Only use alternative decomposeParDict for s...- Cleanup/centralize handling of -decomposeParDict by relocating
common code into argList. Ensures that all processes receive
identical information about the -decomposeParDict opton.
- Only use alternative decomposeParDict for simpleFoam/motorBike
tutorial so that this will be included in the test loop for snappy.
- Added Mattijs' fix for surfaceRedistributePar.Version v1612AdminAdminhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/90added optional argument description (Fixes #347)2016-12-16T07:13:24ZPrashant Sonakaradded optional argument description (Fixes #347)Optional argument listed.
@andy @mark Could you confirm/merge?Optional argument listed.
@andy @mark Could you confirm/merge?Version v1612Mark OLESENMark OLESENhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/59BUG: output field name instead of field (fixes #224)2016-09-28T16:00:27ZPrashant SonakarBUG: output field name instead of field (fixes #224)Version v1612AdminAdminhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/83ENH: improve objectRegistry functionality (issue #322)2016-12-06T10:48:43ZMark OLESENENH: improve objectRegistry functionality (issue #322)- Recursive searching for objects within a registry is now optional
(previous it was always done).
A recursive search effectively blocks the construction of sub-sub-registries
if their names are 'masked' by some parent level sub-r...- Recursive searching for objects within a registry is now optional
(previous it was always done).
A recursive search effectively blocks the construction of sub-sub-registries
if their names are 'masked' by some parent level sub-registry with
the same name! (BUG)
- Recursive search is now turned OFF by default, which makes it consistent
with dictionary and probably causes the least number of surprises.
----
Various new convenience methods added:
lookupObjectRef()
- returns a non-const reference.
For example,
volScalarField& U = mesh().lookupObjectRef<volScalarField>("U");
Instead of
volScalarField& U = const_cast<volScalarField&>
(
mesh().lookupObject<volScalarField>("U")
);
--
lookupObjectPtr()
- returns a const pointer, and nullptr on failure.
For example,
const volScalarField* Uptr = mesh().lookupObjectPtr<volScalarField>("U");
if (Uptr)
{
const volScalarField& U = *Uptr;
...
}
Instead of
if (mesh().foundObject<volScalarField>("U"))
{
const volScalarField& U = mesh().lookupObject<volScalarField>("U");
...
}
--
lookupObjectRefPtr()
- returns a non-const pointer, and nullptr on failure.
For example,
volScalarField* Uptr = mesh().lookupObjectRefPtr<volScalarField>("U");
if (Uptr)
{
volScalarField& U = *Uptr; // use as reference
(*Uptr) = ...; // or use directly
}
Instead of
if (mesh().foundObject<volScalarField>("U"))
{
volScalarField& U = const_cast<volScalarField&>
(
mesh().lookupObject<volScalarField>("U")
);
}
--
sortedNames()
- now works with template parameters and with regular expression
matching as well.
For example,
wordList names = mesh().sortedNames();
wordList fields = mesh().sortedName<volScalarField>();
Instead of
wordList names = mesh().sortedNames();
wordList fields = mesh().names<volScalarField>();
Foam::sort(fields);
--Version v1612AdminAdminhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/72External coupled2016-11-15T09:49:59ZMark OLESENExternal coupledImprovements and bugfixes for externalCoupledFunctionObject - issues #278 #269Improvements and bugfixes for externalCoupledFunctionObject - issues #278 #269Version v1612AdminAdminhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/140Bug pstream token sending2017-08-10T12:56:42ZMark OLESENBug pstream token sendingisspace filtering would interfere with sending of tokenType.
This is not currently an issue or a bug, but will become when new token types are added. Instead append the tokenType directly to the buffer.isspace filtering would interfere with sending of tokenType.
This is not currently an issue or a bug, but will become when new token types are added. Instead append the tokenType directly to the buffer.v1712Mark OLESENMark OLESENhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/143BugFix: corrected keyword for flowRateInletVelocity BC fixes #5772017-08-30T08:49:53ZPrashant SonakarBugFix: corrected keyword for flowRateInletVelocity BC fixes #577corrected as : volumetricFlowRate instead of volumeFlowRatecorrected as : volumetricFlowRate instead of volumeFlowRatev1712AdminAdminhttps://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/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/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/372BUG: provide setup backward-compat for actuationDiskSourceCoeffs2020-06-18T20:59:51ZKutalmış BerçinBUG: provide setup backward-compat for actuationDiskSourceCoeffs#1732 @Prashant#1732 @Prashantv2006Andrew HeatherAndrew Heatherhttps://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/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/340ENH: Improve polynomial equations and analytical eigendecompositions2020-02-18T17:31:35ZKutalmış BerçinENH: Improve polynomial equations and analytical eigendecompositions### Summary
Analytical eigendecomposition routines show irregular numerical instabilities particularly for cases wherein off-diagonal elements of a tensor involve noise. The issue revealed to be caused by the polynomialEqn containers,...### Summary
Analytical eigendecomposition routines show irregular numerical instabilities particularly for cases wherein off-diagonal elements of a tensor involve noise. The issue revealed to be caused by the polynomialEqn containers, particularly `cubicEqn`.
In addition, the analytical eigendecomposition routines seem to be mathematically inconsistent since tensors are not allowed to return complex types, which is nevertheless the norm for asymmetric matrices.
Accordingly, this set of commits aims to improve the numerical stability of analytical eigendecompositions, and to provide a group of verification tests to prevent future breaks in the workflow.
[unit-test-notebooks-17-Feb-20.zip](/uploads/bd21eee046e249f3ae4830537472e625/unit-test-notebooks-17-Feb-20.zip)
### Resolved bugs
#1311 #1312 #1527 #1575 #1596
### Risks
Low.
`polynomialEqns` and analytical eigendecomposition routines were considerably isolated from the rest of the code.
@markv2006Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/329BUG: add switch for nu:DphitEff in kEpsilonPhitF (fixes #1560)2020-01-21T12:28:10ZKutalmış BerçinBUG: add switch for nu:DphitEff in kEpsilonPhitF (fixes #1560)Including `nu` in `DphitEff` even though it is not present in (LUU:Eq. 17)
provided higher level of resemblance to benchmarks for the tests considered,
particularly for the peak skin friction (yet, pressure-related predictions
...Including `nu` in `DphitEff` even though it is not present in (LUU:Eq. 17)
provided higher level of resemblance to benchmarks for the tests considered,
particularly for the peak skin friction (yet, pressure-related predictions
were unaffected). Users can switch off `nu` in `DphitEff` by using
`includeNu` entry in `kEpsilonPhitFCoeffs` in order tofollow the
reference paper thereat. `includeNu` is left `true` by default.
See GitLab issue #1560,
- removes redundant `phit()` and `f()` access funcs,
- replaces `dimensionedScalar` with `dimScalar` to gain space.
LUU: Laurence, D. R., Uribe, J. C., & Utyuzhnikov, S. V. (2005).v2006Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/403BUG: globalSum needed in the merit functions' directional derivative (fixes #...2020-12-11T17:39:02ZVaggelis PapoutsisBUG: globalSum needed in the merit functions' directional derivative (fixes #1949)Does not affect the current functionality of shape optimisation.Does not affect the current functionality of shape optimisation.v2012Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/402BUG: Wrong First extrapolated value of the merit function (fixes #1948)2020-12-11T17:37:36ZVaggelis PapoutsisBUG: Wrong First extrapolated value of the merit function (fixes #1948)Affected only the first optimisation cycle, if line search was enabled
If eta was not set explicitly, it was computed after evaluating the
directional derivative of the merit function, which was computed
wrongly, leading to an erroneous...Affected only the first optimisation cycle, if line search was enabled
If eta was not set explicitly, it was computed after evaluating the
directional derivative of the merit function, which was computed
wrongly, leading to an erroneous value of the extrapolated merit
function value.v2012Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/401BUG: collated format and writing of NURBS3DVolume CPs - see #19472020-12-14T18:07:05ZVaggelis PapoutsisBUG: collated format and writing of NURBS3DVolume CPs - see #1947The if(Pstream::master()) clause in NURBS3DVolume::writeCpsInDict() was
causing the fileName of the regIOobject not to be allocated in all
processors, giving problems when masterUncollatedFileOperation::masterOp
was called by collatedFil...The if(Pstream::master()) clause in NURBS3DVolume::writeCpsInDict() was
causing the fileName of the regIOobject not to be allocated in all
processors, giving problems when masterUncollatedFileOperation::masterOp
was called by collatedFileOperation::writeObject for the mkDirOp.v2012Andrew HeatherAndrew Heatherhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/474Hot fixes for v21062021-06-25T08:09:56ZAndrew HeatherHot fixes for v2106Corrected fan BC construction from dict - see #2138
- propagated valueRequired through constructor args to avoid multiple/incorrect constructor initialisations as lower levels are constructed
Added backwards compatibility for deprecated...Corrected fan BC construction from dict - see #2138
- propagated valueRequired through constructor args to avoid multiple/incorrect constructor initialisations as lower levels are constructed
Added backwards compatibility for deprecated `partialFaceAreaWeightAMI` class
- functionality now available using `faceAreaWeightAMI`
- added alias to AMI run-time selection tablev2106Mattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comMattijs Janssens4-Mattijs@users.noreply.develop.openfoam.comhttps://develop.openfoam.com/Development/openfoam/-/merge_requests/454ENH: turbulentDFSEMInlet: various improvements2021-06-22T09:18:22ZKutalmış BerçinENH: turbulentDFSEMInlet: various improvements### Summary
- ENH: Input entries of `R`, `L` and `U` are now `PatchFunction1` type.
- ENH: Adds two scalar normalisation factors for input `R`, `L` and `U`: `Uref` and `Lref` (default=1).
- ENH: Adds a scalar factor to enable users to t...### Summary
- ENH: Input entries of `R`, `L` and `U` are now `PatchFunction1` type.
- ENH: Adds two scalar normalisation factors for input `R`, `L` and `U`: `Uref` and `Lref` (default=1).
- ENH: Adds a scalar factor to enable users to tune the C1 normalisation coefficient: `scale` (default=1).
- BUG: MappedFile: separates scopes of entries.
- TUT: Replaces `chan395DFSEM` and `PCF` tutorials with `planeChannel` and `oneCellThickPlaneChannel` tutorials.
- Corrects the integral-length scale input files.
- Updates the [Extended Code Guide's channel flow](https://www.openfoam.com/documentation/guides/latest/doc/verification-validation-turbulent-plane-channel-flow.html) case, and allows users to reproduce the results.
### Resolved bugs (If applicable)
#2098
#2097
#2090
#1004
#1744
#2089
### Details of new models (If applicable)
A set of results obtained from the `planeChannel` tutorial (and its plot script available to users) with a different set of settings can be seen below:
##### Ruv vs y
![Ruv_vs_y](/uploads/0a9a5a8b41f5c19a8ccacc3d1614d554/Ruv_vs_y.png)
##### u vs y
![u_vs_y](/uploads/e43ae1708a96ba6c77955d33e4ebf5ca/u_vs_y.png)
##### Ruu vs y
![Ruu_vs_y](/uploads/d30bcba9424ab2cf2fd63f9ebcb41285/Ruu_vs_y.png)
##### x vs Cf
![x_vs_cf](/uploads/c7f25cfb42129756c84d9a76ce010170/x_vs_cf.png)
##### Rvv vs y
![Rvv_vs_y](/uploads/aa956075682e9331172a0ddbd92ab727/Rvv_vs_y.png)
##### Rww vs y
![Rww_vs_y](/uploads/00cdcd67ba65659f8469c59415a46d23/Rww_vs_y.png)
### Risks
##### User input
Users (my apologies) will have to change the input syntax for `R`, `L` and `U` entries. For example, for reading the input files in `constant/boundaryData/inlet/0/`, users were using the following minimal syntax:
```
inlet
{
type turbulentDFSEMInlet;
delta 1;
mapMethod nearestCell;
value $internalField;
}
```
For the same effect, one of the syntax examples could be as follows:
```
inlet
{
type turbulentDFSEMInlet;
delta 1;
U mappedFile;
R mappedFile;
L mappedFile;
mapMethod nearest;
value $internalField;
}
```
or as follows:
```
inlet
{
type turbulentDFSEMInlet;
delta 1;
U
{
type mappedFile;
mapMethod nearest;
}
R
{
type mappedFile;
mapMethod nearest;
}
L
{
type mappedFile;
mapMethod nearest;
}
value $internalField;
}
```
Users can, however, use any of the `PatchFunction1` input syntax exemplified in this [link](https://www.openfoam.com/news/main-news/openfoam-v1812/core#core-patch-function1) and this [link](https://www.openfoam.com/news/main-news/openfoam-v20-06/pre-processing#pre-processing-expression-patchfunction1).
##### Regressions
- ~~The default value of `nCellPerEddy` entry was changed from 5 to 1, which is the default value corresponding to the original journal paper.~~
- The default value of `nCellPerEddy` entry was kept the same as 5.
##### Remaining issues
- Arguably, the DFSEM method has various theoretical issues that need to be addressed (see #2090). We have been trying to reach the originators of the method during the last couple of years; and we will continue our efforts, if possible, to cooperate with them to resolve some of these issues.v2106Andrew HeatherAndrew Heather