ENH: simplify turbulentDigitalFilterInlet BC

This commit is contained in:
Kutalmis Bercin
2020-04-27 09:18:30 +01:00
committed by Andrew Heather
parent 4a798b9ea5
commit 60809c3f50
34 changed files with 851 additions and 1041 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -30,152 +30,179 @@ Group
grpInletBoundaryConditions grpInletBoundaryConditions
Description Description
Velocity boundary condition generating synthetic turbulence-alike Digital-filter based boundary condition for velocity, i.e. \c U, to generate
time-series for LES and DES turbulent flow computations. synthetic turbulence-alike time-series for LES and DES turbulent flow
computations from input turbulence statistics.
To this end, two synthetic turbulence generators can be chosen:
- Digital-filter method-based generator (DFM)
References:
\verbatim \verbatim
Klein, M., Sadiki, A., and Janicka, J. Digital-filter method-based generator (DFM) (tag:KSJ):
A digital filter based generation of inflow data for spatially Klein, M., Sadiki, A., & Janicka, J. (2003).
developing direct numerical or large eddy simulations, A digital filter based generation of inflow data for spatially
Journal of Computational Physics (2003) 186(2):652-665. developing direct numerical or large eddy simulations.
doi:10.1016/S0021-9991(03)00090-1 Journal of computational Physics, 186(2), 652-665.
DOI:10.1016/S0021-9991(03)00090-1
Forward-stepwise method-based generator (FSM) (tag:XC)
Xie, Z. T., & Castro, I. P. (2008).
Efficient generation of inflow conditions for
large eddy simulation of street-scale flows.
Flow, turbulence and combustion, 81(3), 449-470.
DOI:10.1007/s10494-008-9151-5
Mass-inflow rate correction (tag:KCX):
Kim, Y., Castro, I. P., & Xie, Z. T. (2013).
Divergence-free turbulence inflow conditions for
large-eddy simulations with incompressible flow solvers.
Computers & Fluids, 84, 56-68.
DOI:10.1016/j.compfluid.2013.06.001
\endverbatim \endverbatim
- Forward-stepwise method-based generator (FSM) In \c DFM or \c FSM, a random number set (mostly white noise), and a group
\verbatim
Xie, Z.-T., and Castro, I.
Efficient generation of inflow conditions for large eddy simulation of
street-scale flows, Flow, Turbulence and Combustion (2008) 81(3):449-470
doi:10.1007/s10494-008-9151-5
\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 of target statistics (mostly mean flow, Reynolds stress tensor profiles and
length-scale sets) are fused into a new number set (stochastic time-series, length-scale sets) are merged into a new number set (stochastic time-series,
yet consisting of the statistics) by a chain of mathematical operations yet consisting of the statistics) by a chain of mathematical operations
whose characteristics are designated by the target statistics, so that the whose characteristics are designated by the target statistics, so that the
realised statistics of the new sets could match the target. realised statistics of the new sets could match the target.
\verbatim
Random number sets ---->-| Random number sets ---->-|
| |
DFM or FSM ---> New stochastic time-series consisting DFM or FSM ---> New stochastic time-series consisting
| turbulence statistics | turbulence statistics
Turbulence statistics ->-| Turbulence statistics ->-|
\endverbatim
The main difference between DFM and FSM is that the latter replaces the The main difference between \c DFM and \c FSM is that \c FSM replaces
streamwise convolution summation in DFM by a simpler and a quantitatively the expensive-to-run streamwise convolution summation in \c DFM by a simpler
justified equivalent procedure in order to reduce computational costs. and an almost-equivalent-in-effect numerical procedure in order to reduce
Accordingly, the latter potentially brings resource advantages for computational costs. Accordingly, \c FSM potentially brings computational
computations involving relatively large length-scale sets and small resource advantages for computations involving relatively large streamwise
time-steps. length-scale sets and small time-steps.
Synthetic turbulence is produced on a virtual rectangular structured-mesh Synthetic turbulence is generated on a virtual rectangular structured-mesh
turbulence plane, which is parallel to the actual patch, and is mapped onto plane, which is parallel to the chosen patch, and is mapped onto this patch
the chosen patch by the selected mapping method. by the selected mapping method.
Usage Usage
\table Example of the boundary condition specification:
Property | Description | Required | Default value
planeDivisions | Number of nodes on turbulence plane (e2, e3) [-] | yes |
L | Integral length-scale set (9-comp):{e1,e2,e3}{u,v,w} [m] | yes |
R | Reynolds stress tensor set (xx xy xz yy yz zz) [m2/s2] | yes |
patchNormalSpeed | Characteristic mean flow speed [m/s] | yes |
isGaussian | Autocorrelation function form | no | true
isFixedSeed | Flag to identify random-number seed is fixed | no | true
isContinuous | Flag for random-number restart behaviour | no | false
isCorrectedFlowRate | Flag for mass flow rate correction | no | true
interpolateR | Placeholder flag: interpolate R field | no | false
interpolateUMean | Placeholder flag: interpolate UMean field | no | false
isInsideMesh | Placeholder flag: TP is inside mesh or on patch | no | false
isTaylorHypot | Placeholder flag: Taylor's hypothesis is on | no | true
mapMethod | Method to map reference values | no | nearestCell
threshold | Threshold to avoid unintentional 'tiny' input | no | 1e-8
modelConst | Model constant (Klein et al., Eq. 14) | no | -0.5*PI
perturb | Point perturbation for interpolation | no | 1e-5
const1FSM | A model coefficient in FSM (Xie-Castro, Eq. 14) | no | -0.25*PI
const2FSM | A model coefficient in FSM (Xie-Castro, Eq. 14) | no | -0.5*PI
\endtable
Minimal example of the boundary condition specification with commented
options:
\verbatim \verbatim
<patchName> <patchName>
{ {
type turbulentDigitalFilter; // Mandatory entries (unmodifiable)
variant digitalFilter; // reducedDigitalFilter; type turbulentDigitalFilterInlet;
planeDivisions (<planeDivisionsHeight> <planeDivisionsWidth>); n (<nHeight> <nWidth>);
L (<Lxu> <Lxv> <Lxw> <Lyu> <Lyv> <Lyw> <Lzu> <Lzv> <Lzw>); L (<L1> <L2> ... <L9>);
R (<Rxx> <Rxy> <Rxz> <Ryy> <Ryz> <Rzz>); R uniform (<Rxx> <Rxy> <Rxz> <Ryy> <Ryz> <Rzz>);
patchNormalSpeed <characteristic flow speed>; UMean uniform (1 0 0);
value uniform (0 0 0); // mandatory placeholder Ubulk 10.0;
// Optional entries with default input // Optional entries (unmodifiable)
isGaussian true; // false // always false for FSM fsm false;
isFixedSeed true; // false Gaussian true; // always false for FSM
isContinuous false; // true fixSeed true;
isCorrectedFlowRate true; // false continuous false;
interpolateR false; // placeholder correctFlowRate true;
interpolateUMean false; // placeholder mapMethod nearestCell;
isInsideMesh false; // placeholder
isTaylorHypot true; // placeholder
mapMethod nearestCell; // planarInterpolation
threshold 1e-8;
modelConst -1.5707; //-0.5*PI;
perturb 1e-5; perturb 1e-5;
C1 -1.5707; //-0.5*PI;
C1FSM -0.7854 //-0.25*PI;
C2FSM -1.5707; //-0.5*PI;
// Optional entries for only FSM with default input // Optional (inherited) entries
const1FSM -0.7854 //-0.25*PI; ...
const2FSM -1.5707; //-0.5*PI;
} }
\endverbatim \endverbatim
Among the dictionary entries, two entries can be input as patch profiles: where the entries mean:
\table
Property | Description | Type | Req'd | Dflt
type | Type name: turbulentDigitalFilterInlet | word | yes | -
n | Number of cells on turbulence generation plane <!--
--> | tuple of labels | yes | -
L | Integral length-scale set <!--
--> (Lxu Lxv Lxw Lyu Lyv Lyw Lzu Lzv Lzw) [m] | tensor | yes | -
R | Reynolds stress tensor set <!--
--> (xx xy xz yy yz zz) [m2/s2] | symmTensorField | yes | -
UMean | Mean velocity profile [m/s] | vectorField | yes | -
Ubulk | Characteristic patch-normal bulk flow speed [m/s] <!--
--> | scalar | yes | -
fsm | Flag to turn on the forward-stepwise method | bool | no | false
Gaussian | Autocorrelation function form | bool | no | true
fixSeed | Flag to fix random-number generator seed to 1234 <!--
--> or generate a new seed based on clock-time per simulation <!--
--> | bool | no | true
continuous | Flag to write random-number sets at output time, <!--
--> and to read them on restart. Otherwise, generate <!--
--> new random-number sets of restart | bool | no false
correctFlowRate | Flag to correct mass-inflow rate on turbulence <!--
--> plane in (only) streamwise direction | bool | no | true
mapMethod | Interpolation-to-patch method | word | no | nearestCell
perturb | Point perturbation for planarInterpolation mapMethod <!--
--> | scalar | no | 1e-5
C1 | Model constant shaping autocorrelation function <!--
--> (KSJ:Eq. 14) | scalar | no | -0.5*PI
C1FSM | Model coefficient in FSM (XC:Eq. 14) | scalar | no | -0.25*PI
C2FSM | Model coefficient in FSM (XC:Eq. 14) | scalar | no | -0.5*PI
\endtable
The inherited entries are elaborated in:
- \link fixedValueFvPatchFields.H \endlink
Options for the \c fsm entry:
\verbatim \verbatim
- Reynolds stress tensor, R false | Method due to (KSJ)
- Mean velocity, UMean true | Method due to (XC)
\endverbatim \endverbatim
Profile data and corresponding coordinates are then input in the following Options for the \c Gaussian entry:
directories:
\verbatim \verbatim
- $FOAM_CASE/constant/boundaryData/\<patchName\>/points true | Gaussian function
- $FOAM_CASE/constant/boundaryData/\<patchName\>/0/\{R|UMean\} false | Exponential function (only option for FSM)
\endverbatim \endverbatim
The profile data and corresponding coordinates take the same form used by Options for the \c mapMethod entry:
the \c timeVaryingMappedFixedValue and \c turbulentDFSEMInlet boundary \verbatim
conditions, consisting of a \c points file containing a list of 3-D nearestCell | One-to-one direct map, no interpolation
coordinates, and profile data files providing a value per coordinate. planarInterpolation | Bilinear interpolation
\endverbatim
Reynolds stress tensor and mean velocity input are in the global coordinate Patch-profile input is available for two entries:
system whereas integral length scale set input is in the local patch \verbatim
coordinate system. R | Reynolds stress tensor
UMean | Mean velocity
\endverbatim
where the input profiles and profile coordinates are located in:
\verbatim
Coordinates | $FOAM_CASE/constant/boundaryData/\<patchName\>/points
R/UMean | $FOAM_CASE/constant/boundaryData/\<patchName\>/0/\{R/UMean\}
\endverbatim
It is assumed that the patch normal direction is \c e1, and the remaining \c points file contains a list of three-dimensional coordinates, and
patch plane directions are \c e2 and \c e3 following the right-handed profile data files provide a value corresponding to each coordinate.
coordinate system, which should be taken into consideration when the
integral length scale set is input. The first three integral scale entries,
i.e. L_e1u, Le1v, Le2w, should always correspond to the length scales
that are in association with the convective mean flow direction.
Note Note
- \c mapMethod \c planarInterpolation option requires point coordinates - \c mapMethod=planarInterpolation option needs point coordinates that can
which can form a plane, thus input point coordinates varying only in a form a plane.
single direction will trigger error. - \c adjustTimeStep=true option is currently not fully supported.
- \c adjustTimeStep = true option is not fully supported at the moment. - In order to obtain Reynolds stress tensor information, experiments, RANS
simulations or engineering relations can be used.
- \c continuous=true means deterministic-statistical consistent restart
(relatively more expensive), and \c continuous=false means deterministic
discontinuity in synthetic turbulence time-series by keeping statistical
consistency (relatively cheaper).
- For \c L, the first three entries should always correspond to the
length scales in association with the convective (streamwise) mean flow
direction.
- Streamwise integral length scales are converted to integral time scales
by using Taylor's frozen turbulence hypothesis, and \c Ubulk.
SeeAlso See also
turbulentDFSEMInletFvPatchVectorField.C - turbulentDFSEMInletFvPatchVectorField.C
SourceFiles SourceFiles
turbulentDigitalFilterInletFvPatchVectorField.C turbulentDigitalFilterInletFvPatchVectorField.C
turbulentDigitalFilterInletFvPatchVectorFieldTemplates.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -184,7 +211,6 @@ SourceFiles
#include "fixedValueFvPatchFields.H" #include "fixedValueFvPatchFields.H"
#include "Random.H" #include "Random.H"
#include <functional>
#include "fieldTypes.H" #include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -202,172 +228,125 @@ class turbulentDigitalFilterInletFvPatchVectorField
: :
public fixedValueFvPatchVectorField public fixedValueFvPatchVectorField
{ {
// Private Enumerations
//- Options for the synthetic turbulence generator variant
enum variantType : uint8_t
{
DIGITAL_FILTER = 1, //!< Digital-filter method (Klein et al.)
FORWARD_STEPWISE = 2, //!< Forward-stepwise method (Xie-Castro)
};
//- Names for variant types
static const Enum<variantType> variantNames;
// Private Data // Private Data
//- 2D interpolation (for 'planarInterpolation' mapMethod) //- Bilinear interpolation (for 'mapMethod=planarInterpolation')
mutable autoPtr<pointToPointPlanarInterpolation> mapperPtr_; mutable autoPtr<pointToPointPlanarInterpolation> mapperPtr_;
//- Selected option for the synthetic turbulence generator variant //- Flag to enable the forward-stepwise method
const enum variantType variant_; const bool fsm_;
//- Flag: correlation function form is Gaussian or Exponential //- Flag to select correlation function form: Gaussian or exponential
// for variantType::DIGITAL_FILTER, default=Gaussian const bool Gaussian_;
// for variantType::FORWARD_STEPWISE, default=Exponential (only option)
const bool isGaussian_;
//- Flag: random-number generator seed is fixed (default=true) or //- Flag to fix the random-number generator seed to 1234 or
//- generated pseudo-randomly based on clock-time per simulation //- generate a new seed based on clock-time per simulation
const bool isFixedSeed_; const bool fixSeed_;
//- Flag: write non-manipulated random-number sets at output time, and //- Flag to write random-number sets at output time, and to read them
//- to read them on restart. Otherwise, generate new random-number sets //- on restart. Otherwise, generate new random-number sets on restart
//- on restart. (default=false) const bool continuous_;
// true: deterministic & statistically consistent, more expensive
// false: deterministic discontinuity & statistically consistent, cheaper
const bool isContinuous_;
//- Flag: mass flow rate is corrected on turbulence plane (default=true) //- Flag to correct mass flow rate on turbulence plane
const bool isCorrectedFlowRate_; const bool correctFlowRate_;
//- Flag: interpolate R field (default=false) //- Internal flag to read R from data files
bool interpolateR_; bool interpR_;
//- Flag: interpolate UMean field (default=false) //- Internal flag to read UMean from data files
bool interpolateUMean_; bool interpUMean_;
//- Flag: turbulence plane is inside mesh or on a patch (default=false)
// Currently, true option is not available.
const bool isInsideMesh_;
//- Flag: convert streamwise (x) length scales to time scales by
//- Taylor's 'frozen turbulence' hypothesis (default=true)
// Currently, false option is not available.
const bool isTaylorHypot_;
//- Method for interpolation between a patch and turbulence plane //- Method for interpolation between a patch and turbulence plane
//- (default=nearestCell)
// Options:
// - nearestCell: one-to-one direct map, no interpolation
// - planarInterpolation: bilinear interpolation
const word mapMethod_; const word mapMethod_;
//- Current time index //- Current time index
label curTimeIndex_; label curTimeIndex_;
//- Threshold to avoid unintentional 'tiny' input scalars (default=1e-8) //- Characteristic patch-normal bulk flow speed [m/s]
const scalar tiny_; const scalar Ubulk_;
//- Characteristic (e.g. bulk) mean speed of flow in the patch normal //- Model constant shaping autocorrelation function (KSJ:Eq. 14)
//- direction [m/s] const scalar C1_;
const scalar patchNormalSpeed_;
//- Model constant shaping autocorr function [-] (default='-0.5*pi') //- Fraction of perturbation (fraction of bounding box) to add
// (Klein et al., 2003, Eq. 14)
const scalar modelConst_;
//- Fraction of perturbation (fraction of bounding box) to add (for
//- 'planarInterpolation' mapMethod)
const scalar perturb_; const scalar perturb_;
//- Initial (first time-step) mass/vol flow rate [m^3/s] //- First time-step mass/volumetric flow rate
scalar initialFlowRate_; scalar flowRate_;
//- Random number generator //- Random number generator
Random rndGen_; Random rndGen_;
//- Number of nodes on turbulence plane (e2 e3) [-] //- Number of cells on turbulence plane (<nHeight> <nWidth>) [-]
const Tuple2<label, label> planeDivisions_; const Tuple2<label, label> n_;
//- Turbulence plane mesh size (reversed) (e2 e3) [1/m] //- Uniform mesh size on turbulence plane (reversed) [1/m]
Vector2D<scalar> invDelta_; Vector2D<scalar> invDelta_;
//- Nearest cell mapping: Index pairs between patch and turbulence plane //- Index pairs between patch and turbulence plane
//- for the nearest cell mapping
const List<Pair<label>> indexPairs_; const List<Pair<label>> indexPairs_;
//- Reynolds stress tensor profile (xx xy xz yy yz zz) in global //- Reynolds stress tensor profile field in global coordinates [m2/s2]
//- coordinates [m^2/s^2] const symmTensorField R_;
symmTensorField R_;
//- Lund-Wu-Squires transformation (Cholesky decomp.) [m/s] //- Lund-Wu-Squires transformed R field (Cholesky decomp.) [m/s]
//- Mapped onto actual mesh patch rather than turbulence plane //- Mapped onto actual mesh patch rather than turbulence plane
// (Klein et al., 2003, Eq. 5) // (KSJ:Eq. 5)
symmTensorField LundWuSquires_; const symmTensorField Lund_;
//- Mean inlet velocity profile in global coordinates [m/s] //- Mean inlet velocity profile field in global coordinates [m/s]
vectorField UMean_; vectorField UMean_;
//- Integral length-scale set per turbulence plane section in local //- Integral length-scale set per turbulence plane section in local
//- coordinates (e1u, e1v, e1w, e2u, e2v, e2w, e3u, e3v, e3w) [m] //- coordinates (e1u, e1v, e1w, e2u, e2v, e2w, e3u, e3v, e3w) [m]
// First three entries should always correspond to the length scales
// in association with the convective mean flow direction
// Backup of L_ for restart purposes // Backup of L_ for restart purposes
const tensor Lbak_; const tensor Lbak_;
//- Integral length-scale set in mesh units [node] //- Integral length-scale set in mesh units [cell]
const tensor L_; const tensor L_;
//- One of the two model coefficients in FSM //- One of the two model coefficients in FSM
// (Xie-Castro, 2008, the argument of the first exp func in Eq. 14) // (XC:The argument of the first exp func in Eq. 14)
const scalar const1FSM_; const scalar C1FSM_;
//- One of the two model coefficients in FSM //- One of the two model coefficients in FSM
// (Xie-Castro, 2008, the argument of the second exp func in Eq. 14) // (XC:The argument of the second exp func in Eq. 14)
const scalar const2FSM_; const scalar C2FSM_;
//- One of the two exponential functions in FSM //- One of the two exponential functions in FSM
// (Xie-Castro, 2008, the first exponential function in Eq. 14) // (XC:The first exponential function in Eq. 14)
const List<scalar> constList1FSM_; const List<scalar> coeffs1FSM_;
//- One of the two exponential functions in FSM //- One of the two exponential functions in FSM
// (Xie-Castro, 2008, the first exponential function in Eq. 14) // (XC:The first exponential function in Eq. 14)
const List<scalar> constList2FSM_; const List<scalar> coeffs2FSM_;
//- Number of nodes in random-number box [node] //- Number of cells in random-number box [cell]
//- Random-number sets within box are filtered with filterCoeffs_ //- Random-number sets within box are filtered with filterCoeffs_
//- (e1u, e1v, e1w, e2u, e2v, e2w, e3u, e3v, e3w) const List<label> szBox_;
const List<label> lenRandomBox_;
//- Convenience factors for 2-D random-number box [-] //- Convenience factors for two-dimensional random-number box [-]
const List<label> randomBoxFactors2D_; const List<label> boxFactors2D_;
//- Convenience factors for 3-D randomNum box [-] //- Convenience factors for three-dimensional random-number box [-]
const List<label> randomBoxFactors3D_; const List<label> boxFactors3D_;
//- Index to the first elem of last plane of random-number box [-] //- Index to the first elem of last plane of random-number box [-]
const List<label> iNextToLastPlane_; const List<label> iNextToLastPlane_;
//- Random-number sets distributed over a 3-D box (u, v, w) //- Random-number sets distributed over three-dimensional box (u, v, w)
List<List<scalar>> randomBox_; List<List<scalar>> box_;
//- Filter coefficients corresponding to L_ [-] //- Filter coefficients corresponding to L [-]
const List<List<scalar>> filterCoeffs_; const List<List<scalar>> filterCoeffs_;
//- Filter-applied random-number sets [m/s] (effectively turb plane) //- Filter-applied random-number sets [m/s], i.e. turbulence plane
List<List<scalar>> filteredRandomBox_; List<List<scalar>> filteredBox_;
//- Filter-applied previous-time-step velocity field [m/s] used in FSM //- Filter-applied previous-time-step velocity field [m/s] used in FSM
vectorField U0_; vectorField U0_;
//- Run-time function selector between the original and reduced methods
const std::function
<
void(turbulentDigitalFilterInletFvPatchVectorField*, vectorField&)
> computeVariant;
// Private Member Functions // Private Member Functions
@ -393,82 +372,59 @@ class turbulentDigitalFilterInletFvPatchVectorField
//- Generate random-number sets obeying the standard normal distribution //- Generate random-number sets obeying the standard normal distribution
template<class Form, class Type> template<class Form, class Type>
Form generateRandomSet(const label len); Form randomSet(const label len);
//- Compute nearest cell index-pairs between turbulence plane and patch //- Compute nearest cell index-pairs between turbulence plane and patch
List<Pair<label>> patchIndexPairs(); List<Pair<label>> indexPairs();
//- Check R_ (mapped on actual mesh) for mathematical domain errors //- Check R on patch for mathematical domain errors
void checkRTensorRealisable() const; void checkR() const;
//- Compute Lund-Wu-Squires transformation //- Compute Lund-Wu-Squires transformation
// (Klein et al., 2003, Eq. 5) symmTensorField calcLund() const;
symmTensorField computeLundWuSquires() const;
//- Compute patch-normal into the domain //- Compute the first time-step mass/
vector computePatchNormal() const; //- volumetric flow rate based on UMean
scalar calcFlowRate() const;
//- Compute initial (first time-step) mass/vol flow rate based on UMean_ //- Convert integral length scales in meters
scalar computeInitialFlowRate() const; //- to turbulence plane cell-size units
tensor meterToCell(const tensor& L) const;
//- Convert streamwise integral length scales to integral time scales
//- via Taylor's frozen turbulence hypothesis
void convertToTimeScale(tensor& L) const;
//- Convert length scale phys. unit to turbulence plane mesh-size unit
//- (Klein et al., 2003, Eq. 13)
tensor convertScalesToGridUnits(const tensor& L) const;
//- Resource allocation functions for the convenience factors //- Resource allocation functions for the convenience factors
List<label> initLenRandomBox() const; List<label> initBox() const;
List<label> initBoxFactors2D() const; List<label> initFactors2D() const;
List<label> initBoxFactors3D() const; List<label> initFactors3D() const;
List<label> initBoxPlaneFactors() const; List<label> initPlaneFactors() const;
//- Compute various convenience factors for random-number box //- Compute various convenience factors for random-number box
List<List<scalar>> fillRandomBox(); List<List<scalar>> fillBox();
//- Compute filter coeffs once per simulation //- Compute filter coeffs once per simulation
// (Klein et al., 2003, Eq. 14) List<List<scalar>> calcFilterCoeffs() const;
List<List<scalar>> computeFilterCoeffs() const;
//- Discard current time-step random-box plane (closest to patch) by //- Discard current time-step random-box plane (closest to patch) by
//- shifting from the back to the front, and dd new plane to the back //- shifting from the back to the front, and add new plane to the back
void rndShiftRefill(); void shiftRefill();
//- Map two-point correlated random-number sets on patch based on chosen //- Map two-point correlated random-number sets
//- mapping method //- on patch based on chosen mapping method
void mapFilteredRandomBox(vectorField& U); void mapFilteredBox(vectorField& U);
//- Map R_ on patch //- Embed one-point correlations, i.e. R, on patch
void embedOnePointCorrs(vectorField& U) const; void onePointCorrs(vectorField& U) const;
//- Map UMean_ on patch //- Embed two-point correlations, i.e. L, on box
void embedMeanVelocity(vectorField& U) const; // Three-dimensional "valid"-type separable
// convolution summation algorithm
// (Based on Song Ho Ahn's two-dimensional "full"-type convolution)
void twoPointCorrs();
//- Correct mass/vol flow rate in (only) streamwise direction //- Compute coeffs1FSM_ once per simulation
void correctFlowRate(vectorField& U) const; List<scalar> calcCoeffs1FSM() const;
//- 3-D 'valid'-type 'separable' convolution summation algorithm //- Compute coeffs2FSM_ once per simulation
// 'Inspired' from Song Ho Ahn's 2-D 'full'-type convolution algorithm List<scalar> calcCoeffs2FSM() const;
// with his permission
void embedTwoPointCorrs();
//- Compute the DFM (Klein et al., 2003)
void computeDFM(vectorField& U);
//- Compute the reduced DFM (i.e. hybrid FSM-DFM) (Xie-Castro, 2008)
void computeReducedDFM(vectorField& U);
//- Compute constList1FSM_ once per simulation
List<scalar> computeConstList1FSM() const;
//- Compute constList2FSM_ once per simulation
List<scalar> computeConstList2FSM() const;
//- Compute the forward-stepwise method
// (Xie-Castro, 2008, Eq. 14)
void computeFSM(vectorField& U);
public: public:
@ -476,6 +432,7 @@ public:
//- Runtime type information //- Runtime type information
TypeName("turbulentDigitalFilterInlet"); TypeName("turbulentDigitalFilterInlet");
// Constructors // Constructors
//- Construct from patch and internal field //- Construct from patch and internal field
@ -550,6 +507,19 @@ public:
virtual void updateCoeffs(); virtual void updateCoeffs();
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap(const fvPatchFieldMapper& m);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchVectorField& ptf,
const labelList& addr
);
//- Write //- Write
virtual void write(Ostream&) const; virtual void write(Ostream&) const;
}; };

View File

@ -5,8 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -123,7 +122,7 @@ Foam::turbulentDigitalFilterInletFvPatchVectorField::interpolateBoundaryData
const rawIOField<Type> vals(io, false); const rawIOField<Type> vals(io, false);
Info<< "Turbulent DFM/FSM patch " << patchName Info<< "turbulentDigitalFilterInlet patch " << patchName
<< ": Interpolating field " << fieldName << ": Interpolating field " << fieldName
<< " from " << valsFile << endl; << " from " << valsFile << endl;
@ -132,7 +131,7 @@ Foam::turbulentDigitalFilterInletFvPatchVectorField::interpolateBoundaryData
template<class Form, class Type> template<class Form, class Type>
Form Foam::turbulentDigitalFilterInletFvPatchVectorField::generateRandomSet Form Foam::turbulentDigitalFilterInletFvPatchVectorField::randomSet
( (
const label len const label len
) )
@ -149,4 +148,5 @@ Form Foam::turbulentDigitalFilterInletFvPatchVectorField::generateRandomSet
return randomSet; return randomSet;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class volVectorField; class volVectorField;
location "0";
object U; object U;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -21,34 +20,28 @@ internalField uniform (0 0 0);
boundaryField boundaryField
{ {
bottomWall "bottomWall|topWall"
{ {
type fixedValue; type fixedValue;
value uniform (0 0 0); value $internalField;
} }
topWall
{ "left|right"
type fixedValue;
value uniform (0 0 0);
}
left
{
type cyclic;
}
right
{ {
type cyclic; type cyclic;
} }
inlet inlet
{ {
value uniform (0 0 0); value $internalField;
} }
#include "inlet/U" #include "inlet/U"
outlet outlet
{ {
type inletOutlet; type inletOutlet;
inletValue uniform (0 0 0); inletValue $internalField;
value uniform (0 0 0); value $internalField;
} }
} }

View File

@ -16,12 +16,15 @@ FoamFile
inlet inlet
{ {
type turbulentDigitalFilterInlet; type turbulentDigitalFilterInlet;
variant digitalFilter; n ( 64 70 );
planeDivisions ( 64 70 ); L
L ( 0.78035508 0.31085352 0.342261 0.1728125 0.171875 (
0.22459375 0.172787596 0.171889998 0.224578995 ); 0.78035508 0.31085352 0.342261 0.1728125 0.171875
patchNormalSpeed 20.133; 0.22459375 0.172787596 0.171889998 0.224578995
);
Ubulk 20.133;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -22,4 +22,5 @@ inlet
mapMethod nearestCell; mapMethod nearestCell;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -16,12 +16,16 @@ FoamFile
inlet inlet
{ {
type turbulentDigitalFilterInlet; type turbulentDigitalFilterInlet;
variant reducedDigitalFilter; fsm true;
planeDivisions ( 64 70 ); n ( 64 70 );
L ( 0.78035508 0.31085352 0.342261 0.1728125 0.171875 L
0.22459375 0.172787596 0.171889998 0.224578995 ); (
patchNormalSpeed 20.133; 0.78035508 0.31085352 0.342261 0.1728125 0.171875
0.22459375 0.172787596 0.171889998 0.224578995
);
Ubulk 20.133;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class volScalarField; class volScalarField;
location "0";
object nut; object nut;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -21,28 +20,17 @@ internalField uniform 0;
boundaryField boundaryField
{ {
bottomWall "bottomWall|topWall"
{ {
type zeroGradient; type zeroGradient;
} }
topWall
{ "left|right"
type zeroGradient;
}
left
{ {
type cyclic; type cyclic;
} }
right
{ "inlet|outlet"
type cyclic;
}
inlet
{
type calculated;
value uniform 1e-08;
}
outlet
{ {
type calculated; type calculated;
value uniform 1e-08; value uniform 1e-08;

View File

@ -10,7 +10,6 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class volScalarField; class volScalarField;
location "0";
object p; object p;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -21,30 +20,20 @@ internalField uniform 0;
boundaryField boundaryField
{ {
bottomWall "bottomWall|topWall|inlet"
{ {
type zeroGradient; type zeroGradient;
} }
topWall
{ "left|right"
type zeroGradient;
}
left
{ {
type cyclic; type cyclic;
} }
right
{
type cyclic;
}
inlet
{
type zeroGradient;
}
outlet outlet
{ {
type fixedValue; type fixedValue;
value uniform 0; value $internalField;
} }
} }

View File

@ -4,6 +4,11 @@ cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
cleanCase0 cleanCase0
\rm -rf system/controlDict constant/boundaryData/inlet results
rm -f system/controlDict
rm -rf constant/boundaryData/inlet
rm -rf results
rm -f *.png
rm -f constant/{R*,points*,UMean*}
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -4,15 +4,6 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions . ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
endTime=10
\cp system/controlDict.template system/controlDict
if notTest "$@"
then
endTime=85
fi
\sed -i "s|END_TIME|$endTime|g" system/controlDict
# Collect data into the 'results' directory, # Collect data into the 'results' directory,
# and clean the case for the next run # and clean the case for the next run
# #
@ -20,14 +11,15 @@ fi
# ---- # ----
collectData(){ collectData(){
model=$1 model=$1
\echo " Moving results into 'results/$model'" runType=$2
results="results/$model" echo " Moving results into 'results/$model.$runType'"
\mkdir -p "$results" results="results/$model.$runType"
mkdir -p "$results"
timeDir=$(foamListTimes -latestTime) timeDir=$(foamListTimes -latestTime)
\mv -f log* *.png postProcessing "$timeDir" "$results" 2>/dev/null mv -f log* *.png postProcessing "$timeDir" "$results" 2>/dev/null
cleanTimeDirectories cleanTimeDirectories
\rm -rf processor* > /dev/null 2>&1 rm -rf processor* > /dev/null 2>&1
} }
@ -40,13 +32,13 @@ serialRun(){
models=$* models=$*
for model in $models for model in $models
do do
\echo " Running with the synthetic turbulence model: $model" echo " Running with the synthetic turbulence model: $model"
(\cd 0 && \ln -snf "inlet.$model" inlet) (cd 0 && ln -snf "inlet.$model" inlet)
(\cd constant/boundaryData && \ln -snf "inlet.$model" inlet) (cd constant/boundaryData && ln -snf "inlet.$model" inlet)
runApplication -s "$model" $(getApplication) runApplication -s "$model" $(getApplication)
./plot ./plot
collectData $model collectData $model "serial"
done done
} }
@ -60,36 +52,35 @@ parallelRun(){
models=$* models=$*
for model in $models for model in $models
do do
\echo " Running with the synthetic turbulence model: $model" echo " Running with the synthetic turbulence model: $model"
(\cd 0 && \ln -snf "inlet.$model" inlet) (cd 0 && ln -snf "inlet.$model" inlet)
(\cd constant/boundaryData && \ln -snf "inlet.$model" inlet) (cd constant/boundaryData && ln -snf "inlet.$model" inlet)
runApplication -s "$model" decomposePar runApplication -s "$model" decomposePar -force
runParallel -s "$model" $(getApplication) runParallel -s "$model" $(getApplication)
runApplication -s "$model" reconstructPar -latestTime
./plot ./plot
collectData $model "parallel"
collectData $model
done done
} }
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Synthetic inflow models # Prepare the numerical setup
./Allrun.pre
# Run with the synthetic turbulence models
models=" models="
reducedDigitalFilter FSM
digitalFilter DFM
DFSEM DFSEM
" "
# Prepare the numerical setup parallelRun $models
runApplication blockMesh
restore0Dir
\rm -rf "results"
# Run with the synthetic turbulence models
serialRun $models serialRun $models
#parallelRun $models
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -0,0 +1,20 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
endTime=85
if notTest "$@"
then
endTime=10
fi
sed "s|END_TIME|$endTime|g" system/controlDict.template > system/controlDict
restore0Dir
runApplication blockMesh
rm -rf results
#------------------------------------------------------------------------------

View File

@ -1,12 +1,11 @@
Synthetic turbulence inflow tests #------------------------------------------------------------------------------
======================
The following three synthetic turbulence inflow boundary conditions are The following three synthetic turbulence inflow boundary conditions are
examined through a single-cell-domain smooth-wall plane channel flow setup: examined through a single-cell-domain smooth-wall plane channel flow setup:
- turbulentDFSEMInlet - turbulentDFSEMInlet (DFSEM)
- turbulentDigitalFilterInlet variant=digitalFilter - turbulentDigitalFilterInlet (DFM)
- turbulentDigitalFilterInlet variant=reducedDigitalFilter - turbulentDigitalFilterInlet with the forward-stepwise method (FSM)
The input statistics are obtained from: The input statistics are obtained from:
@ -22,13 +21,12 @@ The data is available online from (Retrieved: 21-06-2019):
https://turbulence.oden.utexas.edu/data/MKM/chan395/ https://turbulence.oden.utexas.edu/data/MKM/chan395/
Serial executing (comment out 'parallelRun'): Executing:
./Allrun
Parallel (decompositionMethod=scotch) executing (comment out 'serialRun'):
./Allrun ./Allrun
The script will run the test case, and collect the plots and samples into The script will run the test case, and collect the plots and samples into
the 'results' directory. the 'results' directory.
#------------------------------------------------------------------------------

View File

@ -0,0 +1,135 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------
plotCellR() {
timeDir=$1
echo " Plotting the normal and Reynolds stresses on cell."
outName="stress-cell.png"
gnuplot<<PLT_CELL_R
set terminal pngcairo font "helvetica,20" size 1000, 800
set xrange [0:1]
set yrange [-1:8]
set grid
set key top right
set key samplen 2
set key spacing 0.75
set xlabel "Channel height from the bottomWall [m]"
set ylabel "<u_i^' u_i^'> [m2/s2]"
set offset .05, .05
set output "$outName"
set title "Normal and Reynolds stresses on cell"
input = "$timeDir/inletCell_UPrime2Mean.xy"
bench = "constant/pointsRdata"
plot \
input u 1:2 t "<u^' u^'>" w l lw 2 lc rgb "#009E73", \
input u 1:5 t "<v^' v^'>" w l lw 2 lc rgb "#F0E440", \
input u 1:7 t "<w^' w^'>" w l lw 2 lc rgb "#0072B2", \
input u 1:3 t "<u^' v^'>" w l lw 2 lc rgb "#D55E00", \
bench u 2:4 t "<u^' u^'>_{DNS}" w l lw 2 dt 2 lc rgb "#009E73", \
bench u 2:7 t "<v^' v^'>_{DNS}" w l lw 2 dt 2 lc rgb "#F0E440", \
bench u 2:9 t "<w^' w^'>_{DNS}" w l lw 2 dt 2 lc rgb "#0072B2", \
bench u 2:5 t "<u^' v^'>_{DNS}" w l lw 2 dt 2 lc rgb "#D55E00"
PLT_CELL_R
}
plotPatchR() {
timeDir=$1
echo " Plotting the normal and Reynolds stresses on inlet patch faces."
outName="stress-patch.png"
gnuplot<<PLT_PATCH_R
set terminal pngcairo font "helvetica,20" size 1000, 800
set xrange [0:1]
set yrange [-1:8]
set grid
set key top right
set key samplen 2
set key spacing 0.75
set xlabel "Channel height from the bottomWall [m]"
set ylabel "<u_i^' u_i^'> [m2/s2]"
set offset .05, .05
set output "$outName"
set title "Normal and Reynolds stresses on patch"
input = "$timeDir/inletPatch_UPrime2Mean.xy"
bench = "constant/pointsRdata"
plot \
input u 1:2 t "<u^' u^'>" w l lw 2 lc rgb "#009E73", \
input u 1:5 t "<v^' v^'>" w l lw 2 lc rgb "#F0E440", \
input u 1:7 t "<w^' w^'>" w l lw 2 lc rgb "#0072B2", \
input u 1:3 t "<u^' v^'>" w l lw 2 lc rgb "#D55E00", \
bench u 2:4 t "<u^' u^'>_{DNS}" w l lw 2 dt 2 lc rgb "#009E73", \
bench u 2:7 t "<v^' v^'>_{DNS}" w l lw 2 dt 2 lc rgb "#F0E440", \
bench u 2:9 t "<w^' w^'>_{DNS}" w l lw 2 dt 2 lc rgb "#0072B2", \
bench u 2:5 t "<u^' v^'>_{DNS}" w l lw 2 dt 2 lc rgb "#D55E00"
PLT_PATCH_R
}
plotPatchUMean() {
timeDir=$1
echo " Plotting the streamwise mean flow speed on inlet patch faces."
outName="u-patch.png"
gnuplot<<PLT_PATCH_UMEAN
set terminal pngcairo font "helvetica,20" size 1000, 800
set xrange [0:1]
set yrange [0:25]
set grid
set key top right
set key samplen 2
set key spacing 0.75
set xlabel "Channel height from the bottomWall [m]"
set ylabel "u [m/s]"
set offset .05, .05
set output "$outName"
input = "$timeDir/inletPatch_UMean.xy"
bench = "constant/pointsUMeanData"
plot \
input u 1:2 t "u" w l lw 2 lc rgb "#009E73", \
bench u 2:4 t "u_{DNS}" w l lw 2 dt 2 lc rgb "#009E73"
PLT_PATCH_UMEAN
}
#------------------------------------------------------------------------------
# Require gnuplot
command -v gnuplot >/dev/null || {
echo "gnuplot not found - skipping graph creation" 1>&2
exit 1
}
# Prepare the benchmark data
cp -f constant/boundaryData/inlet/0/R constant/R
cp -f constant/boundaryData/inlet/points constant/points
cp -f constant/boundaryData/inlet.DFM/0/UMean constant/UMean
cat constant/R | tr -d '()' > constant/Rdata
cat constant/points | tr -d '()' > constant/pointsData
cat constant/UMean | tr -d '()' > constant/UMeanData
paste constant/pointsData constant/Rdata > constant/pointsRdata
paste constant/pointsData constant/UMeanData > constant/pointsUMeanData
# The latestTime in postProcessing/sampling1
timeDir=$(foamListTimes -case postProcessing/sampling1 -latestTime 2>/dev/null)
[ -n "$timeDir" ] || {
echo "No postProcessing/sampling1 found - skipping graph creation" 1>&2
exit 1
}
timeDir="postProcessing/sampling1/$timeDir"
plotCellR "$timeDir"
plotPatchR "$timeDir"
plotPatchUMean "$timeDir"
#------------------------------------------------------------------------------

View File

@ -88,4 +88,5 @@ mergePatchPairs
( (
); );
// ************************************************************************* // // ************************************************************************* //

View File

@ -29,7 +29,7 @@ deltaT 4e-3;
writeControl timeStep; writeControl timeStep;
writeInterval 1250; writeInterval 50;
purgeWrite 3; purgeWrite 3;
@ -47,13 +47,59 @@ runTimeModifiable false;
adjustTimeStep false; adjustTimeStep false;
// Allow 10% of time for initialisation before sampling // Allow 10% of time for initialisation before sampling
timeStart #eval #{ 0.1 * ${/endTime} #}; timeStart #eval #{ 0.1 * ${/endTime} #};
functions functions
{ {
#include "fieldAverage" fieldAverage1
#include "sampling" {
type fieldAverage;
libs (fieldFunctionObjects);
writeControl writeTime;
timeStart $/timeStart;
fields
(
U
{
mean on;
prime2Mean on;
base time;
}
);
}
sampling1
{
type sets;
libs (sampling);
interpolationScheme cellPoint;
setFormat raw;
writeControl onEnd;
fields (UPrime2Mean UMean);
sets
(
inletPatch
{
type face;
axis y;
start (0.0 0 1.57);
end (0.0 2 1.57);
}
inletCell
{
type midPoint;
axis y;
start (0.062832 0 1.57);
end (0.062832 2 1.57);
}
);
}
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -10,13 +10,19 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class dictionary;
note "mesh decomposition control dictionary";
object decomposeParDict; object decomposeParDict;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 3; numberOfSubdomains 4;
method hierarchical;
coeffs
{
n (1 2 2);
}
method scotch;
// ************************************************************************* // // ************************************************************************* //

View File

@ -51,4 +51,5 @@ snGradSchemes
default corrected; default corrected;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -1,73 +0,0 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
#------------------------------------------------------------------------------
plotStresses() {
timeDir=$1
\echo " Plotting the normal and Reynolds stresses"
gnuplot<<PLT_STRESSES
set terminal pngcairo font "helvetica,20" size 1000, 800
set xrange [0:1]
set yrange [-1:8]
set grid
set key top right
set xlabel "Channel height from the bottomWall [m]"
set ylabel "<u_i^' u_i^'>"
set offset .05, .05
set style data linespoints
set linetype 1 lc rgb 'black' lw 2
set linetype 2 lc rgb 'red' lw 2
set linetype 3 lc rgb 'blue' lw 2
set linetype 4 lc rgb 'green' lw 2
set linetype 5 lc rgb 'black' pi -8 pt 4 ps 1.5
set linetype 6 lc rgb 'red' pi -8 pt 4 ps 1.5
set linetype 7 lc rgb 'blue' pi -8 pt 4 ps 1.5
set linetype 8 lc rgb 'green' pi -8 pt 4 ps 1.5
set title "Normal and Reynolds stresses on cell"
input="$timeDir/inletCell_UPrime2Mean.xy"
set output 'stress-cell.png'
plot \
input u 1:2 w lines t "<u^' u^'>" lt 1, \
input u 1:5 w lines t "<v^' v^'>" lt 2, \
input u 1:7 w lines t "<w^' w^'>" lt 3, \
input u 1:3 w lines t "<u^' v^'>" lt 4
set title "Normal and Reynolds stresses on patch"
input = "$timeDir/inletPatch_UPrime2Mean.xy"
set output 'stress-patch.png'
plot \
input u 1:2 w lines t "<u^' u^'>" lt 1, \
input u 1:5 w lines t "<v^' v^'>" lt 2, \
input u 1:7 w lines t "<w^' w^'>" lt 3, \
input u 1:3 w lines t "<u^' v^'>" lt 4
PLT_STRESSES
}
#------------------------------------------------------------------------------
# Require gnuplot
command -v gnuplot >/dev/null || {
\echo "gnuplot not found - skipping graph creation" 1>&2
\exit 1
}
# The latestTime in postProcessing/inletSampling
timeDir=$(foamListTimes -case postProcessing/inletSampling -latestTime 2>/dev/null)
[ -n "$timeDir" ] || {
\echo "No postProcessing/inletSampling found - skipping graph creation" 1>&2
\exit 2
}
timeDir="postProcessing/inletSampling/$timeDir"
plotStresses "$timeDir"
#------------------------------------------------------------------------------

View File

@ -1,36 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fieldAverage;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
fieldAverage1
{
type fieldAverage;
libs (fieldFunctionObjects);
writeControl writeTime;
timeStart $/timeStart;
fields
(
U
{
mean on;
prime2Mean on;
base time;
}
);
}
// ************************************************************************* //

View File

@ -1,48 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object sampling;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inletSampling
{
type sets;
libs (sampling);
writeControl writeTime;
timeStart $/timeStart;
interpolationScheme cellPoint;
setFormat raw;
fields (UPrime2Mean);
sets
(
inletPatch
{
type face;
axis y;
start (0.0 0 1.57);
end (0.0 2 1.57);
}
inletCell
{
type midPoint;
axis y;
start (0.062832 0 1.57);
end (0.062832 2 1.57);
}
);
}
// ************************************************************************* //