mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into develop
This commit is contained in:
@ -126,7 +126,8 @@ void Foam::timeControl::read(const dictionary& dict)
|
||||
case ocCpuTime:
|
||||
case ocAdjustableRunTime:
|
||||
{
|
||||
interval_ = readScalar(dict.lookup(intervalName));
|
||||
const scalar userTime = readScalar(dict.lookup(intervalName));
|
||||
interval_ = time_.userTimeToTime(userTime);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@ -43,8 +43,15 @@ namespace functionObjects
|
||||
|
||||
void Foam::functionObjects::timeControl::readControls()
|
||||
{
|
||||
dict_.readIfPresent("timeStart", timeStart_);
|
||||
dict_.readIfPresent("timeEnd", timeEnd_);
|
||||
if (dict_.readIfPresent("timeStart", timeStart_))
|
||||
{
|
||||
timeStart_ = time_.userTimeToTime(timeStart_);
|
||||
}
|
||||
if (dict_.readIfPresent("timeEnd", timeEnd_))
|
||||
{
|
||||
timeEnd_ = time_.userTimeToTime(timeEnd_);
|
||||
}
|
||||
|
||||
dict_.readIfPresent("nStepsToStartTimeChange", nStepsToStartTimeChange_);
|
||||
}
|
||||
|
||||
|
||||
@ -92,8 +92,8 @@ Foam::autoPtr<Foam::OFstream> Foam::functionObjects::writeFile::createFile
|
||||
|
||||
if (Pstream::master() && writeToFile_)
|
||||
{
|
||||
const word startTimeName =
|
||||
fileObr_.time().timeName(fileObr_.time().startTime().value());
|
||||
const scalar timeNow = fileObr_.time().timeOutputValue()
|
||||
const word startTimeName = Time::timeName(timeNow);
|
||||
|
||||
fileName outputDir(baseFileDir()/prefix_/startTimeName);
|
||||
|
||||
@ -105,7 +105,7 @@ Foam::autoPtr<Foam::OFstream> Foam::functionObjects::writeFile::createFile
|
||||
IFstream is(outputDir/(fName + ".dat"));
|
||||
if (is.good())
|
||||
{
|
||||
fName = fName + "_" + fileObr_.time().timeName();
|
||||
fName = fName + "_" + startTimeName;
|
||||
}
|
||||
|
||||
osPtr.set(new OFstream(outputDir/(fName + ".dat")));
|
||||
@ -258,7 +258,8 @@ void Foam::functionObjects::writeFile::writeHeader
|
||||
|
||||
void Foam::functionObjects::writeFile::writeTime(Ostream& os) const
|
||||
{
|
||||
os << setw(charWidth()) << fileObr_.time().timeName();
|
||||
const scalar timeNow = fileObr_.time().timeOutputValue()
|
||||
os << setw(charWidth()) << Time::timeName(timeNow);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -254,7 +254,7 @@ bool Foam::ensightOutput::writeField
|
||||
forAll(patchIds, listi)
|
||||
{
|
||||
const label patchId = patchIds[listi];
|
||||
const word& patchName = patchLookup[listi];
|
||||
const word& patchName = patchLookup[patchId];
|
||||
const ensightFaces& ensFaces = patchFaces[patchName];
|
||||
|
||||
writeFaceField
|
||||
|
||||
@ -44,6 +44,7 @@ Description
|
||||
|
||||
The weight applies to the first scheme and 1-weight to the second scheme.
|
||||
|
||||
Usage
|
||||
Example of the CoBlended scheme specification using LUST for Courant numbers
|
||||
less than 1 and linearUpwind for Courant numbers greater than 10:
|
||||
\verbatim
|
||||
|
||||
@ -176,8 +176,9 @@ bool Foam::functionObjects::blendingFactor::write()
|
||||
<< " blended cells : " << nCellsBlended << nl
|
||||
<< endl;
|
||||
|
||||
writeTime(file());
|
||||
|
||||
file()
|
||||
<< time_.time().value()
|
||||
<< token::TAB << nCellsScheme1
|
||||
<< token::TAB << nCellsScheme2
|
||||
<< token::TAB << nCellsBlended
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -98,7 +98,7 @@ void Foam::functionObjects::fieldAverage::initialize()
|
||||
}
|
||||
}
|
||||
|
||||
// ensure first averaging works unconditionally
|
||||
// Ensure first averaging works unconditionally
|
||||
prevTimeIndex_ = -1;
|
||||
|
||||
Log << endl;
|
||||
@ -108,7 +108,8 @@ void Foam::functionObjects::fieldAverage::initialize()
|
||||
|
||||
void Foam::functionObjects::fieldAverage::restart()
|
||||
{
|
||||
Log << " Restarting averaging at time " << obr().time().timeName()
|
||||
Log << " Restarting averaging at time "
|
||||
<< obr().time().timeOutputValue()
|
||||
<< nl << endl;
|
||||
|
||||
totalIter_.clear();
|
||||
@ -221,7 +222,8 @@ void Foam::functionObjects::fieldAverage::readAveragingProperties()
|
||||
|
||||
if (restartOnRestart_ || restartOnOutput_)
|
||||
{
|
||||
Info<< " Starting averaging at time " << obr().time().timeName()
|
||||
Info<< " Starting averaging at time "
|
||||
<< obr().time().timeOutputValue()
|
||||
<< nl;
|
||||
}
|
||||
else
|
||||
@ -240,15 +242,18 @@ void Foam::functionObjects::fieldAverage::readAveragingProperties()
|
||||
totalIter_[fieldi] = readLabel(fieldDict.lookup("totalIter"));
|
||||
totalTime_[fieldi] = readScalar(fieldDict.lookup("totalTime"));
|
||||
|
||||
scalar userTotalTime =
|
||||
obr().time().timeToUserTime(totalTime_[fieldi]);
|
||||
|
||||
Info<< " " << fieldName
|
||||
<< " iters = " << totalIter_[fieldi]
|
||||
<< " time = " << totalTime_[fieldi] << nl;
|
||||
<< " time = " << userTotalTime << nl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " " << fieldName
|
||||
<< ": starting averaging at time "
|
||||
<< obr().time().timeName() << endl;
|
||||
<< obr().time().timeOutputValue() << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -312,7 +317,8 @@ bool Foam::functionObjects::fieldAverage::read(const dictionary& dict)
|
||||
|
||||
if (periodicRestart_)
|
||||
{
|
||||
dict.lookup("restartPeriod") >> restartPeriod_;
|
||||
scalar userRestartPeriod = readScalar(dict.lookup("restartPeriod"));
|
||||
restartPeriod_ = obr().time().userTimeToTime(userRestartPeriod);
|
||||
|
||||
if (restartPeriod_ > 0)
|
||||
{
|
||||
@ -323,22 +329,25 @@ bool Foam::functionObjects::fieldAverage::read(const dictionary& dict)
|
||||
++periodIndex_;
|
||||
}
|
||||
|
||||
Info<< " Restart period " << restartPeriod_
|
||||
<< " - next restart at " << (restartPeriod_*periodIndex_)
|
||||
Info<< " Restart period " << userRestartPeriod
|
||||
<< " - next restart at " << (userRestartPeriod*periodIndex_)
|
||||
<< nl << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
periodicRestart_ = false;
|
||||
|
||||
Info<< " Restart period " << restartPeriod_
|
||||
Info<< " Restart period " << userRestartPeriod
|
||||
<< " - ignored"
|
||||
<< nl << endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (dict.readIfPresent("restartTime", restartTime_))
|
||||
scalar userRestartTime = 0;
|
||||
if (dict.readIfPresent("restartTime", userRestartTime))
|
||||
{
|
||||
restartTime_ = obr().time().userTimeToTime(userRestartTime);
|
||||
|
||||
if (currentTime > restartTime_)
|
||||
{
|
||||
// The restart time is already in the past - ignore
|
||||
@ -346,7 +355,7 @@ bool Foam::functionObjects::fieldAverage::read(const dictionary& dict)
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< " Restart scheduled at time " << restartTime_
|
||||
Info<< " Restart scheduled at time " << userRestartTime
|
||||
<< nl << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,6 +122,8 @@ Foam::functionObjects::wallHeatFlux::wallHeatFlux
|
||||
mesh_.objectRegistry::store(wallHeatFluxPtr);
|
||||
|
||||
read(dict);
|
||||
|
||||
writeFileHeader(file());
|
||||
}
|
||||
|
||||
|
||||
@ -267,8 +269,9 @@ bool Foam::functionObjects::wallHeatFlux::write()
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
writeTime(file());
|
||||
|
||||
file()
|
||||
<< mesh_.time().value()
|
||||
<< token::TAB << pp.name()
|
||||
<< token::TAB << minHfp
|
||||
<< token::TAB << maxHfp
|
||||
|
||||
@ -249,7 +249,9 @@ bool Foam::functionObjects::wallShearStress::write()
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
file() << mesh_.time().value()
|
||||
writeTime(file());
|
||||
|
||||
file()
|
||||
<< token::TAB << pp.name()
|
||||
<< token::TAB << minSsp
|
||||
<< token::TAB << maxSsp
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -186,7 +186,7 @@ void Foam::functionObjects::forceCoeffs::writeBinData
|
||||
Ostream& os
|
||||
) const
|
||||
{
|
||||
os << obr_.time().value();
|
||||
writeTime(os);
|
||||
|
||||
for (label bini = 0; bini < nBin_; bini++)
|
||||
{
|
||||
@ -250,6 +250,14 @@ bool Foam::functionObjects::forceCoeffs::read(const dictionary& dict)
|
||||
// Free stream velocity magnitude
|
||||
dict.lookup("magUInf") >> magUInf_;
|
||||
|
||||
// If case is compressible we must read rhoInf (store in rhoRef_) to
|
||||
// calculate the reference dynamic pressure
|
||||
// - note: for incompressible, rhoRef_ is already initialised
|
||||
if (rhoName_ != "rhoInf")
|
||||
{
|
||||
dict.lookup("rhoInf") >> rhoRef_;
|
||||
}
|
||||
|
||||
// Reference length and area scales
|
||||
dict.lookup("lRef") >> lRef_;
|
||||
dict.lookup("Aref") >> Aref_;
|
||||
|
||||
@ -593,8 +593,9 @@ void Foam::functionObjects::forces::writeIntegratedForceMoment
|
||||
{
|
||||
Ostream& os = osPtr();
|
||||
|
||||
os << obr_.time().value()
|
||||
<< tab << total
|
||||
writeTime(os);
|
||||
|
||||
os << tab << total
|
||||
<< tab << pressure
|
||||
<< tab << viscous;
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ void Foam::functionObjects::thermoCoupleProbes::sampleAndWrite
|
||||
|
||||
probeStream
|
||||
<< setw(w)
|
||||
<< vField.time().timeToUserTime(vField.time().value());
|
||||
<< vField.time().timeOutputValue();
|
||||
|
||||
forAll(*this, probeI)
|
||||
{
|
||||
|
||||
@ -45,7 +45,7 @@ void Foam::patchProbes::sampleAndWrite
|
||||
|
||||
probeStream
|
||||
<< setw(w)
|
||||
<< vField.time().timeToUserTime(vField.time().value());
|
||||
<< vField.time().timeOutputValue();
|
||||
|
||||
forAll(values, probei)
|
||||
{
|
||||
@ -71,7 +71,7 @@ void Foam::patchProbes::sampleAndWrite
|
||||
|
||||
probeStream
|
||||
<< setw(w)
|
||||
<< sField.time().timeToUserTime(sField.time().value());
|
||||
<< sField.time().timeOutputValue();
|
||||
|
||||
forAll(values, probei)
|
||||
{
|
||||
|
||||
@ -76,7 +76,7 @@ void Foam::probes::sampleAndWrite
|
||||
unsigned int w = IOstream::defaultPrecision() + 7;
|
||||
OFstream& os = *probeFilePtrs_[vField.name()];
|
||||
|
||||
os << setw(w) << vField.time().timeToUserTime(vField.time().value());
|
||||
os << setw(w) << vField.time().timeOutputValue();
|
||||
|
||||
forAll(values, probei)
|
||||
{
|
||||
@ -100,7 +100,7 @@ void Foam::probes::sampleAndWrite
|
||||
unsigned int w = IOstream::defaultPrecision() + 7;
|
||||
OFstream& os = *probeFilePtrs_[sField.name()];
|
||||
|
||||
os << setw(w) << sField.time().timeToUserTime(sField.time().value());
|
||||
os << setw(w) << sField.time().timeOutputValue();
|
||||
|
||||
forAll(values, probei)
|
||||
{
|
||||
|
||||
@ -51,16 +51,15 @@ functions
|
||||
{
|
||||
type forceCoeffs;
|
||||
libs ("libforces.so");
|
||||
writeControl timeStep;
|
||||
writeInterval 1;
|
||||
writeControl writeTime;
|
||||
|
||||
patches
|
||||
(
|
||||
WALL10
|
||||
wall_4
|
||||
);
|
||||
|
||||
log true;
|
||||
rhoInf 1;
|
||||
|
||||
CofR (0 0 0);
|
||||
liftDir (-0.239733 0.970839 0);
|
||||
dragDir (0.970839 0.239733 0);
|
||||
|
||||
Reference in New Issue
Block a user