mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: noise models - enable the use of environment variables in input file names. Fixes #285
This commit is contained in:
@ -116,7 +116,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
dictName,
|
dictName.expand(),
|
||||||
runTime,
|
runTime,
|
||||||
IOobject::MUST_READ
|
IOobject::MUST_READ
|
||||||
)
|
)
|
||||||
|
|||||||
@ -46,6 +46,11 @@ addToRunTimeSelectionTable(noiseModel, surfaceNoise, dictionary);
|
|||||||
|
|
||||||
void surfaceNoise::initialise(const dictionary& dict)
|
void surfaceNoise::initialise(const dictionary& dict)
|
||||||
{
|
{
|
||||||
|
dict.lookup("inputFile") >> inputFileName_;
|
||||||
|
inputFileName_.expand();
|
||||||
|
|
||||||
|
dict.readIfPresent("fftWriteInterval", fftWriteInterval_);
|
||||||
|
|
||||||
label nAvailableTimes = 0;
|
label nAvailableTimes = 0;
|
||||||
|
|
||||||
// All reading performed on the master processor only
|
// All reading performed on the master processor only
|
||||||
@ -418,13 +423,13 @@ Foam::scalar surfaceNoise::surfaceAverage
|
|||||||
surfaceNoise::surfaceNoise(const dictionary& dict)
|
surfaceNoise::surfaceNoise(const dictionary& dict)
|
||||||
:
|
:
|
||||||
noiseModel(dict),
|
noiseModel(dict),
|
||||||
inputFileName_(dict.lookup("inputFile")),
|
inputFileName_("unknown-inputFile"),
|
||||||
pIndex_(0),
|
pIndex_(0),
|
||||||
times_(),
|
times_(),
|
||||||
deltaT_(0),
|
deltaT_(0),
|
||||||
startTimeIndex_(0),
|
startTimeIndex_(0),
|
||||||
nFace_(0),
|
nFace_(0),
|
||||||
fftWriteInterval_(dict.lookupOrDefault("fftWriteInterval", 1))
|
fftWriteInterval_(1)
|
||||||
{
|
{
|
||||||
initialise(dict);
|
initialise(dict);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -116,7 +116,7 @@ protected:
|
|||||||
// Protected Data
|
// Protected Data
|
||||||
|
|
||||||
//- Input file name
|
//- Input file name
|
||||||
const fileName inputFileName_;
|
fileName inputFileName_;
|
||||||
|
|
||||||
//- Index of pressure field in reader field list
|
//- Index of pressure field in reader field list
|
||||||
label pIndex_;
|
label pIndex_;
|
||||||
|
|||||||
Reference in New Issue
Block a user