openfoam merge requestshttps://develop.openfoam.com/Development/openfoam//merge_requests20190619T21:07:00Zhttps://develop.openfoam.com/Development/openfoam//merge_requests/269Integration adjoint20190619T21:07:00ZAdminIntegration adjoint## New adjoint optimisation and tools
A set of libraries and executables creating a workflow for performing
gradientbased optimisation loops. The main executable (adjointOptimisationFoam)
solves the flow (primal) equations, followe...## New adjoint optimisation and tools
A set of libraries and executables creating a workflow for performing
gradientbased optimisation loops. The main executable (adjointOptimisationFoam)
solves the flow (primal) equations, followed by the adjoint equations and,
eventually, the computation of sensitivity derivatives.
Current functionality supports the solution of the adjoint equations for
incompressible turbulent flows, including the adjoint to the SpalartAllmaras
turbulence model and the adjoint to the nutUSpaldingWallFunction, [1], [2].
Sensitivity derivatives are computed with respect to the normal displacement of
boundary wall nodes/faces (the socalled sensitivity maps) following the
Enhanced Surface Integrals (ESI) formulation, [3].
The software was developed by PCOpt/NTUA and FOSS GP, with contributions from
 Dr. Evangelos PapoutsisKiachagias,
 Konstantinos Gkaragounis,
 Professor Kyriakos Giannakoglou,
 Andy Heather
and contributions in earlier version from
 Dr. Ioannis Kavvadias,
 Dr. Alexandros Zymaris,
 Dr. Dimitrios Papadimitriou
[1] A.S. Zymaris, D.I. Papadimitriou, K.C. Giannakoglou, and C. Othmer.
Continuous adjoint approach to the SpalartAllmaras turbulence model for
incompressible flows. Computers & Fluids, 38(8):1528–1538, 2009.
[2] E.M. PapoutsisKiachagias and K.C. Giannakoglou. Continuous adjoint methods
for turbulent flows, applied to shape and topology optimization: Industrial
applications. 23(2):255–299, 2016.
[3] I.S. Kavvadias, E.M. PapoutsisKiachagias, and K.C. Giannakoglou. On the
proper treatment of grid sensitivities in continuous adjoint methods for shape
optimization. Journal of Computational Physics, 301:1–18, 2015.
## Integration
Integration into the official OpenFOAM release by OpenCFDv1906AdminAdminhttps://develop.openfoam.com/Development/openfoam//merge_requests/267TUT: pimpleFoam/channelDFSEM395  added example use of Lamb vector20190613T20:21:39ZKutalmış BerçinTUT: pimpleFoam/channelDFSEM395  added example use of Lamb vectorTested settingsTested settingsAdminAdminhttps://develop.openfoam.com/Development/openfoam//merge_requests/266Feature vof update solvers20190607T08:38:37ZSergio FerrarisFeature vof update solversNew chtMultiRegionTwoPhaseEulerFoam solver, plus corresponding BC's. Integrated MULES and CMULES new interfaces and the corresponding multiphase solvers and tutorials. All multiphase Euler tutorials are updated.
Inter type of tutorials h...New chtMultiRegionTwoPhaseEulerFoam solver, plus corresponding BC's. Integrated MULES and CMULES new interfaces and the corresponding multiphase solvers and tutorials. All multiphase Euler tutorials are updated.
Inter type of tutorials have been tested (to confirm the correct modification of new MULESinterfaces)
New library src/phaseSystemModels for the phases systems, submodels, BC's, turbulence of the solver twoPhaseReactingEulerFoam and multiphaseReactingEulerFoam. This lib was taken out of the Euler solvers and located on /srcv1906AdminAdminhttps://develop.openfoam.com/Development/openfoam//merge_requests/265ENH: add PDRsetFields utility20191217T10: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.
![simplecage](/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.
![simplecage](/uploads/6782621d04c86e360314258cc96f3bc0/simplecage.png)v1912Sergio FerrarisSergio Ferrarishttps://develop.openfoam.com/Development/openfoam//merge_requests/264Feature complex cleanup20190604T10:35:36ZKutalmış BerçinFeature complex cleanupMark OLESENMark OLESENhttps://develop.openfoam.com/Development/openfoam//merge_requests/263ENH: improved handling of regIOobject deletion (#1276)20190604T19:18:03ZMark OLESENENH: improved handling of regIOobject deletion (#1276) remove registration and ownership before deleting a regIOobject
from within objectRegistry to avoid possible recursion.
 regIOobject destructor now removes any registered object from
registry regardless if ownedByRegistry... remove registration and ownership before deleting a regIOobject
from within objectRegistry to avoid possible recursion.
 regIOobject destructor now removes any registered object from
registry regardless if ownedByRegistry or not. It also removes
always removes the ownership flag to avoid possible recursion.
 the regIOobject::checkOut() now unconditionally clears file watches.
These will only be there if the object is registered (a noop for an
unregistered object), but this additional safety is needed to manage
case where the registration has been modified elsewhere (eg, by the
objectRegistry).
AdminAdminhttps://develop.openfoam.com/Development/openfoam//merge_requests/259Feature dictionary checking20190522T09:29:42ZMark OLESENFeature dictionary checkingAdminAdminhttps://develop.openfoam.com/Development/openfoam//merge_requests/258Feature porting mingw20190508T13:43:39ZMark OLESENFeature porting mingwAdminAdminhttps://develop.openfoam.com/Development/openfoam//merge_requests/257Introduced changes required to make isoAdvector and interIsoFoam work with...20190613T20:48:01ZJohan RoenbyIntroduced changes required to make isoAdvector and interIsoFoam work with...Introduced changes required to make isoAdvector and interIsoFoam work with morphing meshes: 1) In the alphaEqn.H U is made relative to mesh motion before the interface advection step, 2) in isoAdvection::advect() alpha must be multiplied...Introduced changes required to make isoAdvector and interIsoFoam work with morphing meshes: 1) In the alphaEqn.H U is made relative to mesh motion before the interface advection step, 2) in isoAdvection::advect() alpha must be multiplied by Vsc0()/Vsc(). Implementation tested and verified with 1) a spherical interface in a cubic domain with no flow, where the domain walls are squeezed together and 2) a spherical interfacee inside the sloshingCylinder, again with no flow, so the sphere should stay spherical, which it does.v1906Mark OLESENMark OLESENhttps://develop.openfoam.com/Development/openfoam//merge_requests/255Feature dynamic code20190507T16:33:33ZMark OLESENFeature dynamic codeMark OLESENMark OLESENhttps://develop.openfoam.com/Development/openfoam//merge_requests/254ENH: add simple profiling of MPI communications20190429T09:08:31ZMark OLESENENH: add simple profiling of MPI communicationsMattijs Janssens4Mattijs@users.noreply.develop.openfoam.comMattijs Janssens4Mattijs@users.noreply.develop.openfoam.comhttps://develop.openfoam.com/Development/openfoam//merge_requests/253Feature indirect lists20190429T09:48:17ZMark OLESENFeature indirect listsgeneralizes and combines various methods of indirect addressing for lists.generalizes and combines various methods of indirect addressing for lists.AdminAdminhttps://develop.openfoam.com/Development/openfoam//merge_requests/252better cooperation with external MPI initialize / finalize20190410T13:42:12ZMark OLESENbetter cooperation with external MPI initialize / finalizeMattijs Janssens4Mattijs@users.noreply.develop.openfoam.comMattijs Janssens4Mattijs@users.noreply.develop.openfoam.comhttps://develop.openfoam.com/Development/openfoam//merge_requests/249Snappy hex mesh proximity check20190325T16:49:51ZMattijs Janssens4Mattijs@users.noreply.develop.openfoam.comSnappy hex mesh proximity checkAdds snappyHexMesh functionality to remove cells in small gaps (instead of refining them).
See mesh/snappyHexMesh/opposite_walls tutorial.Adds snappyHexMesh functionality to remove cells in small gaps (instead of refining them).
See mesh/snappyHexMesh/opposite_walls tutorial.AdminAdminhttps://develop.openfoam.com/Development/openfoam//merge_requests/246ENH: functionObject: refactored coordinate system usage and new forceCoeffs members20190613T14:47:10ZKutalmış BerçinENH: functionObject: refactored coordinate system usage and new forceCoeffs members* If applied: This commit on top of the current forceCoeffs allows the user to compute:
* Side force coefficient whose direction in curl(lift,drag),
* Yaw moment coefficient whose rotation axis in dir(lift),
* Roll moment coef...* If applied: This commit on top of the current forceCoeffs allows the user to compute:
* Side force coefficient whose direction in curl(lift,drag),
* Yaw moment coefficient whose rotation axis in dir(lift),
* Roll moment coefficient whose rotation axis in dir(drag)
* Also, for developers:
* Destructor is = default
* Some divisions were replaced by multiplications
* Some repetitive multiplications were reduced to a single oper
* Name change: momentCoeff > pitchMomentCoeff
* Order of output is reorganised as moments(pitch,yaw,roll) and forces(lift,drag,side)
* For force coefs, the front and rear axles' contributions are computed
* Verification: Passed sanity checks and valgrindmemcheck
* What's next:
* Update for the Extended code guide entry
* Related:
* Designated pitch, yaw, roll orientation can be seen in:
en.wikipedia.org/wiki/Yaw_(rotation)#/media/File:Flight_dynamics_with_text.pngv1906AdminAdminhttps://develop.openfoam.com/Development/openfoam//merge_requests/245ENH: FO: Lamb vector and its divergence20191108T07:11:42ZKutalmış BerçinENH: FO: Lamb vector and its divergence If applied:
This commit allows the user to compute:
 the Lamb vector (https://en.wikipedia.org/wiki/Lamb_vector),
 (optionally) its divergence
 onthefly or via postProcess utility
 for a... If applied:
This commit allows the user to compute:
 the Lamb vector (https://en.wikipedia.org/wiki/Lamb_vector),
 (optionally) its divergence
 onthefly or via postProcess utility
 for a given volVectorField (one per functionObject entry)
 Why:
The motivation is the literaturereported quantitative connection
between the Lamb vector (divergence) and the spatially localised
instantaneous fluid motions, e.g. high and lowmomentum fluid
parcels, which possess considerable level of capacity to affect
the rate of change of momentum, and to generate forces such as drag.
 Verification:
 Smoothwall plane channel flow case (Moser et al. 1999) by
 Curtis et al. (2008) On the Lamb vector divergence
in Navier–Stokes flows, doi:10.1017/S0022112008002760
 What's next:
 The verificationshow case
 Extended code guide entry titled "Lamb vector"
 Related:
 "fvc::curl(U)^U" is computed twice when "divergence_" is on.
It will be reduced one.AdminAdminhttps://develop.openfoam.com/Development/openfoam//merge_requests/243Feature reflective solar load20190502T09:45:46ZSergio FerrarisFeature reflective solar load### Summary
Adding reflecting fluxes to Solar load radiation model.
Adding functionality to the boundary radiation models and new
place holder for basic wall types such as transparent, opaqueDiffusive,
opaqueReflective. Radiation wall ...### Summary
Adding reflecting fluxes to Solar load radiation model.
Adding functionality to the boundary radiation models and new
place holder for basic wall types such as transparent, opaqueDiffusive,
opaqueReflective. Radiation wall models are now runtime selectable.
Adding multiband capabilities to VF model and improving the set up
for using solar loads in VF and fvDOM radiation models.
### Details of new models (If applicable)
The new entry is useReflectedRays = true in the radiationProperties.
This calculates the reflected rays on reflective walls. It can handle first reflection
on surfaces. Not multiple reflection are considered.
The wall boundary type "opaqueReflective" handles specular reflection which a proportion
of diffusive heat flux
### Risks
(Possible regressions?)
The boundaryRadiationProperties entries key words are "type", not "mode". But a backward
compatibility reading was introduced.v1906AdminAdminhttps://develop.openfoam.com/Development/openfoam//merge_requests/242Reacting heterogeneous cloud20190502T18:40:27ZSergio FerrarisReacting heterogeneous cloud### Summary
New reacting heterogeneous cloud, solver and tutorial.
This cloud is formed of pure solid particles which reacts with the carrier phase.
It is derived from reacting cloud.
### Resolved bugs (If applicable)
(Links to issues...### Summary
New reacting heterogeneous cloud, solver and tutorial.
This cloud is formed of pure solid particles which reacts with the carrier phase.
It is derived from reacting cloud.
### Resolved bugs (If applicable)
(Links to issues)
### Details of new models (If applicable)
The only available reacting heterogeneous model is Heteregeneous noncatalytic reaction MUCS approach.
Reference:
D. Papanastassiou and G. Bitsianes, Modelling of Heterogeneous Gas
Solid Reactions, Metallurgical Transsactions, 480. Volume 4. 1973
### Risks
(Possible regressions?)
(Changes to user inputs?)v1906Mark OLESENMark OLESENhttps://develop.openfoam.com/Development/openfoam//merge_requests/236Feature postpro20190220T19:43:43ZMark OLESENFeature postpro### Summary
Extension of insitu visualization (runTimePostProcessing):
 parallel rendering
 direct use of VTK cutting plane and isosurface filters
 *live* access to simulation data such as lagrangian clouds and geometry patches...### Summary
Extension of insitu visualization (runTimePostProcessing):
 parallel rendering
 direct use of VTK cutting plane and isosurface filters
 *live* access to simulation data such as lagrangian clouds and geometry patches
 the ability to use stored surfaces and fields originating from another function object (eg, sampledSurfaces)
Significant cleanup and reimplementation of the surface sampling function object and all the surface writers to allow persurface format specification. Added support for `.vtp` output of sampled surface with multiple fields in a single file.
Stored surface information can now be used for other field calculations (eg, `surfaceFieldValue`)
Images and description of the new functionality are attached to issue #1206v1906AdminAdminhttps://develop.openfoam.com/Development/openfoam//merge_requests/235DigitalFilter Based Synthetic Turbulence Generation Method for LES/DES Inflow20190621T12:10:50ZKutalmış BerçinDigitalFilter Based Synthetic Turbulence Generation Method for LES/DES Inflow### Summary
Velocity boundary condition generating synthetic turbulencealike
timeseries for LES and DES turbulent flow computations.
To this end, two synthetic turbulence generators can be chosen:
...### Summary
Velocity boundary condition generating synthetic turbulencealike
timeseries for LES and DES turbulent flow computations.
To this end, two synthetic turbulence generators can be chosen:
 Digitalfilter methodbased generator (DFM)
\verbatim
Klein, M., Sadiki, A., and Janicka, J.
A digital filter based generation of inflow data for spatially
developing direct numerical or large eddy simulations,
Journal of Computational Physics (2003) 186(2):652665.
doi:10.1016/S00219991(03)000901
\endverbatim
 Forwardstepwise methodbased generator (FSM)
\verbatim
Xie, Z.T., and Castro, I.
Efficient generation of inflow conditions for large eddy simulation of
streetscale flows, Flow, Turbulence and Combustion (2008) 81(3):449470
doi:10.1007/s1049400891515
\endverbatim
In DFM or FSM, a random number set (mostly white noise), and a group
of target statistics (mostly mean flow, Reynolds stress tensor profiles and
lengthscale sets) are fused into a new number set (stochastic timeseries,
yet consisting of the statistics) by a chain of mathematical operations
whose characteristics are designated by the target statistics, so that the
realised statistics of the new sets could match the target.
Random number sets >

DFM or FSM > New stochastic timeseries consisting
 turbulence statistics
Turbulence statistics >
The main difference between DFM and FSM is that the latter replaces the
streamwise convolution summation in DFM by a simpler and a quantitatively
justified equivalent procedure in order to reduce computational costs.
Accordingly, the latter potentially brings resource advantages for
computations involving relatively large lengthscale sets and small
timesteps.
### Resolved bugs (If applicable)
Verified for `serial`, `scotchparallel (4)`, `hierar.parallel (1 2 2)`, `hierar.parallel (1 2 4)`, `serialrestart`, and `parallelrestart` in terms of input Reynolds stress tensor components through `channel395DFSEM` tutorial (onecell domain).
Checked for various possible (commonly encountered) wrong inputs, e.g. arbitrary Reynolds stress tensor components.
### Details of new models (If applicable)
**The model input**:
1. Spatialvariant Reynolds stress symmetric tensor (6components)
2. Spatialvariant mean velocity profile
3. Spatialinvariant (for now) integrallength scale tensor (9components)
**The model output**: Stochastic timeseries involving the statistics of the model input sets.
**The model computation has four subsequent steps:**
1. Generation of randomnumber sets obeying the standard normal probability distribution function
2. Analytical computation of digitalfilter coefficients as a function of integrallength scales in either Gaussian or exponential form
3. Convolution summation between randomnumber sets and digitalfilter coefficients
4. Embedment of Reynolds stress tensor and mean velocity input into the digitalfiltered randomnumber sets via elementwise multiplication and summation
**Fidelity**:
Preliminary statisticallystationary results from a channelheight profile on the patch (onecell domain `channel395DFSEM` case: `hierar.parallel (1 2 4)`):
![stress](/uploads/8dce71846496e6bbc87aca3c78c52bcb/stress.png)
Preliminary **notstatistically developed** (0.6 sec run, ongoing) with **nonoptimal input** results from full `channel395DFSEM` case:
![DG1](/uploads/49f04599abdd34ec9adec65166c8908f/DG1.png)
**Performance**:
Preliminary comparisons with DFSEM suggests that the current model is ~1.8x faster for the `channel395DFSEM` tutorial.
### Risks
1. Model is itself not divergencefree (yet convertible); therefore, should not be preferred for aeroacoustic applications as is. Nonetheless, the mass flow rate correction reduces the inlet pressure fluctuations to the level of Poletto et al.'s DFSEM (quantified and verified by Bercin in comparison to Moser et al'. DNS data for pressure fluctuations and correlations).
2. For now, Taylor's frozen turbulence hypothesis is applied in the streamwise direction.
3. For now, `bilinear interpolation` is not fully functional.
4. Code duplications with DFSEM exist for template funcs.
5. For now, integrallength scale set (9components) is spatialinvariant across patch.
6. Further verification is ongoing through highorder statistics from Moser et al.'s DNS data, e.g. correlations, kinetic energy budget, enstrophy and so on.AdminAdmin