diff --git a/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C b/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C index f441f125a60851937116692e07855394b716c728..f2bab5983a59aa08178027c26758581f3f6be2c0 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C @@ -31,9 +31,18 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // const Foam::word Foam::functionObjectFile::outputPrefix = "postProcessing"; +Foam::label Foam::functionObjectFile::addChars = 7; // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // +void Foam::functionObjectFile::initStream(Ostream& os) const +{ + os.setf(ios_base::scientific, ios_base::floatfield); +// os.precision(IOstream::defaultPrecision()); + os.width(charWidth()); +} + + Foam::fileName Foam::functionObjectFile::baseFileDir() const { fileName baseDir = obr_.time().path(); @@ -96,6 +105,8 @@ void Foam::functionObjectFile::createFiles() filePtrs_.set(i, new OFstream(outputDir/(fName + ".dat"))); + initStream(filePtrs_[i]); + writeFileHeader(i); i++; @@ -149,7 +160,7 @@ void Foam::functionObjectFile::resetName(const word& name) Foam::Omanip<int> Foam::functionObjectFile::valueWidth(const label offset) const { - return setw(IOstream::defaultPrecision() + 7 + offset); + return setw(IOstream::defaultPrecision() + addChars + offset); } @@ -295,4 +306,42 @@ Foam::OFstream& Foam::functionObjectFile::file(const label i) } +Foam::label Foam::functionObjectFile::charWidth() const +{ + return IOstream::defaultPrecision() + addChars; +} + + +void Foam::functionObjectFile::writeCommented +( + Ostream& os, + const string& str +) const +{ + os << setw(1) << "#" << setw(1) << ' ' + << setw(charWidth() - 2) << str.c_str(); +} + + +void Foam::functionObjectFile::writeTabbed +( + Ostream& os, + const string& str +) const +{ + os << tab << setw(charWidth()) << str.c_str(); +} + + +void Foam::functionObjectFile::writeHeader +( + Ostream& os, + const string& str +) const +{ + os << setw(1) << "#" << setw(1) << ' ' + << setf(ios_base::left) << setw(charWidth() - 2) << str.c_str() << nl; +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.H b/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.H index 54658bdba917cd96305627ab9289f0adcd829919..5488da6e58635a496cb89ffefa4d5c84633eb79d 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.H +++ b/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.H @@ -78,6 +78,9 @@ protected: // Protected Member Functions + //- Initialise the output stream for writing + virtual void initStream(Ostream& os) const; + //- Return the base directory for output virtual fileName baseFileDir() const; @@ -114,6 +117,9 @@ public: //- Folder prefix static const word outputPrefix; + //- Additional characters for writing + static label addChars; + // Constructors //- Construct null @@ -154,13 +160,38 @@ public: //- Return file 'i' OFstream& file(const label i); - //- Write a formatted value to stream + //- Write a commented string to stream + void writeCommented + ( + Ostream& os, + const string& str + ) const; + + //- Write a tabbed string to stream + void writeTabbed + ( + Ostream& os, + const string& str + ) const; + + //- Write a commented header to stream + void writeHeader + ( + Ostream& os, + const string& str + ) const; + + //- Write a (commented) header property and value pair template<class Type> - const char* writeValue + void writeHeaderValue ( - const Type& value, - const label offset = 0 + Ostream& os, + const string& property, + const Type& value ) const; + + //- Return width of character stream output + label charWidth() const; }; diff --git a/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.C b/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.C index 6d338d96bcfd89a6a74f2fabcbc2ec2fba11ae6c..f497c6188c0d70c958b965d63de0a464b5ae2013 100644 --- a/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.C +++ b/src/postProcessing/functionObjects/cloud/cloudInfo/cloudInfo.C @@ -39,7 +39,10 @@ defineTypeNameAndDebug(cloudInfo, 0); void Foam::cloudInfo::writeFileHeader(const label i) { - file(i) << "# Time" << tab << "nParcels" << tab << "mass" << endl; + writeHeader(file(), "Cloud information"); + writeCommented(file(), "Time"); + writeTabbed(file(), "nParcels"); + writeTabbed(file(), "mass"); } diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C index 5c612fe8a3c63045ceb08ed74805ca505b954607..0c61259012ddffbf8dddd9077347ba9e9b31b405 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMax.C @@ -112,20 +112,23 @@ void Foam::fieldMinMax::read(const dictionary& dict) void Foam::fieldMinMax::writeFileHeader(const label i) { - file() - << "# Time" << token::TAB << "field" << token::TAB - << "min" << token::TAB << "position(min)"; + writeHeader(file(), "Field minima and maxima"); + writeCommented(file(), "Time"); + writeTabbed(file(), "field"); + writeTabbed(file(), "min"); + writeTabbed(file(), "position(min)"); if (Pstream::parRun()) { - file() << token::TAB << "proc"; + writeTabbed(file(), "processor"); } - file() << token::TAB << "max" << token::TAB << "position(max)"; + writeTabbed(file(), "max"); + writeTabbed(file(), "position(max)"); if (Pstream::parRun()) { - file() << token::TAB << "proc"; + writeTabbed(file(), "processor"); } file() << endl; diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C index 6bd6102b2e124a3aa64a60f6de2f0bcdf2967566..4aa2a2b6cd9f44c4865e97eb954507ddb800dec8 100644 --- a/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldMinMax/fieldMinMaxTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -111,21 +111,25 @@ void Foam::fieldMinMax::calcMinMaxFields scalar maxValue = maxVs[maxI]; const vector& maxC = maxCs[maxI]; + file()<< obr_.time().value(); + writeTabbed(file(), fieldName); + file() - << obr_.time().value() << token::TAB - << fieldName << token::TAB - << minValue << token::TAB << minC; + << token::TAB << minValue + << token::TAB << minC; if (Pstream::parRun()) { - file() << token::TAB << minI; + file()<< token::TAB << minI; } - file() << token::TAB << maxValue << token::TAB << maxC; + file() + << token::TAB << maxValue + << token::TAB << maxC; if (Pstream::parRun()) { - file() << token::TAB << maxI; + file()<< token::TAB << maxI; } file() << endl; @@ -212,21 +216,25 @@ void Foam::fieldMinMax::calcMinMaxFields Type maxValue = maxVs[maxI]; const vector& maxC = maxCs[maxI]; + file()<< obr_.time().value(); + writeTabbed(file(), fieldName); + file() - << obr_.time().value() << token::TAB - << fieldName << token::TAB - << minValue << token::TAB << minC; + << token::TAB << minValue + << token::TAB << minC; if (Pstream::parRun()) { - file() << token::TAB << minI; + file()<< token::TAB << minI; } - file() << token::TAB << maxValue << token::TAB << maxC; + file() + << token::TAB << maxValue + << token::TAB << maxC; if (Pstream::parRun()) { - file() << token::TAB << maxI; + file()<< token::TAB << maxI; } file() << endl; diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C index 681ea7a02ab15074ce77fe04fda9da4aa0858e9c..b251a362ea8b94673685a16349e9b7268a8e4ed9 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C @@ -94,11 +94,10 @@ void Foam::fieldValues::fieldValueDelta::writeFileHeader(const label i) Ostream& os = file(); - os << "# Source1 : " << source1Ptr_->name() << nl - << "# Source2 : " << source2Ptr_->name() << nl - << "# Operation : " << operationTypeNames_[operation_] << nl; - - os << "# Time"; + writeHeaderValue(os, "Source1", source1Ptr_->name()); + writeHeaderValue(os, "Source2", source2Ptr_->name()); + writeHeaderValue(os, "Operation", operationTypeNames_[operation_]); + writeCommented(os, "Time"); forAll(commonFields, i) { @@ -156,7 +155,7 @@ void Foam::fieldValues::fieldValueDelta::write() if (Pstream::master()) { - file()<< obr_.time().timeName(); + file()<< obr_.time().value(); } if (log_) diff --git a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C index 91943e1191b491a0422c8990ba938522b1e89c1f..1daa0c279cae03ee213653e56b7a6dc3003e2fd3 100644 --- a/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C +++ b/src/postProcessing/functionObjects/forces/forceCoeffs/forceCoeffs.C @@ -45,34 +45,41 @@ void Foam::forceCoeffs::writeFileHeader(const label i) { // force coeff data + writeHeader(file(i), "Force coefficients"); + writeHeaderValue(file(i), "liftDir", liftDir_); + writeHeaderValue(file(i), "dragDir", dragDir_); + writeHeaderValue(file(i), "pitchAxis", pitchAxis_); + writeHeaderValue(file(i), "magUInf", magUInf_); + writeHeaderValue(file(i), "lRef", lRef_); + writeHeaderValue(file(i), "Aref", Aref_); + writeHeaderValue(file(i), "CofR", coordSys_.origin()); + writeCommented(file(i), "Time"); + writeTabbed(file(i), "Cm"); + writeTabbed(file(i), "Cd"); + writeTabbed(file(i), "Cl"); + writeTabbed(file(i), "Cl(f)"); + writeTabbed(file(i), "Cl(r)"); file(i) - << "# liftDir : " << liftDir_ << nl - << "# dragDir : " << dragDir_ << nl - << "# pitchAxis : " << pitchAxis_ << nl - << "# magUInf : " << magUInf_ << nl - << "# lRef : " << lRef_ << nl - << "# Aref : " << Aref_ << nl - << "# CofR : " << coordSys_.origin() << nl - << "# Time" << tab << "Cm" << tab << "Cd" << tab << "Cl" << tab - << "Cl(f)" << tab << "Cl(r)"; + << tab << "Cm" << tab << "Cd" << tab << "Cl" << tab << "Cl(f)" + << tab << "Cl(r)"; } else if (i == 1) { // bin coeff data - file(i) - << "# bins : " << nBin_ << nl - << "# start : " << binMin_ << nl - << "# delta : " << binDx_ << nl - << "# direction : " << binDir_ << nl - << "# Time"; + writeHeader(file(i), "Force coefficient bins"); + writeHeaderValue(file(i), "bins", nBin_); + writeHeaderValue(file(i), "start", binMin_); + writeHeaderValue(file(i), "delta", binDx_); + writeHeaderValue(file(i), "direction", binDir_); + writeCommented(file(i), "Time"); for (label j = 0; j < nBin_; j++) { const word jn('[' + Foam::name(j) + ']'); - - file(i) - << tab << "Cm" << jn << tab << "Cd" << jn << tab << "Cl" << jn; + writeTabbed(file(i), "Cm" + jn); + writeTabbed(file(i), "Cd" + jn); + writeTabbed(file(i), "Cl" + jn); } } else @@ -193,9 +200,8 @@ void Foam::forceCoeffs::write() scalar Clr = Cl/2.0 - Cm; file(0) - << obr_.time().value() << tab - << Cm << tab << Cd << tab << Cl << tab << Clf << tab << Clr - << endl; + << obr_.time().value() << tab << Cm << tab << Cd + << tab << Cl << tab << Clf << tab << Clr << endl; if (log_) { diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index 74b892aa1e9627b5c744bf48977176d162251f12..70c1e00e78e9ab919aa1f5dd0e71a8b634f07698 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -73,11 +73,13 @@ void Foam::forces::writeFileHeader(const label i) { // force data + writeHeader(file(i), "Forces"); + writeHeaderValue(file(i), "CofR", coordSys_.origin()); + writeCommented(file(i), "Time"); + file(i) - << "# CofR : " << coordSys_.origin() << nl - << "# Time" << tab - << "forces(pressure,viscous,porous) " - << "moment(pressure,viscous,porous)"; + << "forces[pressure,viscous,porous] " + << "moment[pressure,viscous,porous]"; if (localSystem_) { @@ -91,32 +93,30 @@ void Foam::forces::writeFileHeader(const label i) { // bin data - file(i) - << "# bins : " << nBin_ << nl - << "# start : " << binMin_ << nl - << "# delta : " << binDx_ << nl - << "# direction : " << binDir_ << nl - << "# Time"; + writeHeader(file(i), "Force bins"); + writeHeaderValue(file(i), "bins", nBin_); + writeHeaderValue(file(i), "start", binMin_); + writeHeaderValue(file(i), "delta", binDx_); + writeHeaderValue(file(i), "direction", binDir_); + writeCommented(file(i), "Time"); for (label j = 0; j < nBin_; j++) { const word jn('[' + Foam::name(j) + ']'); + const word f("forces" + jn + "[pressure,viscous,porous]"); + const word m("moments" + jn + "[pressure,viscous,porous]"); - file(i) - << tab - << "forces" << jn << "(pressure,viscous,porous) " - << "moment" << jn << "(pressure,viscous,porous)"; + file(i)<< tab << f << tab << m; } if (localSystem_) { for (label j = 0; j < nBin_; j++) { const word jn('[' + Foam::name(j) + ']'); + const word f("localForces" + jn + "[pressure,viscous,porous]"); + const word m("localMoments" + jn + "[pressure,viscous,porous]"); - file(i) - << tab - << "localForces" << jn << "(pressure,viscous,porous) " - << "localMoments" << jn << "(pressure,viscous,porous)"; + file(i)<< tab << f << tab << m; } } } @@ -370,28 +370,24 @@ void Foam::forces::writeForces() if (log_) { Info<< type() << " " << name_ << " output:" << nl - << " forces(pressure,viscous,porous) = (" - << sum(force_[0]) << "," - << sum(force_[1]) << "," - << sum(force_[2]) << ")" << nl - << " moment(pressure,viscous,porous) = (" - << sum(moment_[0]) << "," - << sum(moment_[1]) << "," - << sum(moment_[2]) << ")" - << nl; - } - - file(0) << obr_.time().value() << tab - << "(" - << sum(force_[0]) << "," - << sum(force_[1]) << "," - << sum(force_[2]) - << ") " - << "(" - << sum(moment_[0]) << "," - << sum(moment_[1]) << "," - << sum(moment_[2]) - << ")" + << " sum of forces:" << nl + << " pressure : " << sum(force_[0]) << nl + << " viscous : " << sum(force_[1]) << nl + << " porous : " << sum(force_[2]) << nl + << " sum of moments:" << nl + << " pressure : " << sum(moment_[0]) << nl + << " viscous : " << sum(moment_[1]) << nl + << " porous : " << sum(moment_[2]) + << endl; + } + + file(0) << obr_.time().value() << tab << setw(1) << '[' + << sum(force_[0]) << setw(1) << ',' + << sum(force_[1]) << setw(1) << "," + << sum(force_[2]) << setw(3) << "] [" + << sum(moment_[0]) << setw(1) << "," + << sum(moment_[1]) << setw(1) << "," + << sum(moment_[2]) << setw(1) << "]" << endl; if (localSystem_) @@ -403,17 +399,13 @@ void Foam::forces::writeForces() vectorField localMomentT(coordSys_.localVector(moment_[1])); vectorField localMomentP(coordSys_.localVector(moment_[2])); - file(0) << obr_.time().value() << tab - << "(" - << sum(localForceN) << "," - << sum(localForceT) << "," - << sum(localForceP) - << ") " - << "(" - << sum(localMomentN) << "," - << sum(localMomentT) << "," - << sum(localMomentP) - << ")" + file(0) << obr_.time().value() << tab << setw(1) << "[" + << sum(localForceN) << setw(1) << "," + << sum(localForceT) << setw(1) << "," + << sum(localForceP) << setw(3) << "] [" + << sum(localMomentN) << setw(1) << "," + << sum(localMomentT) << setw(1) << "," + << sum(localMomentP) << setw(1) << "]" << endl; } } @@ -448,9 +440,13 @@ void Foam::forces::writeBins() forAll(f[0], i) { file(1) - << tab - << "(" << f[0][i] << "," << f[1][i] << "," << f[2][i] << ") " - << "(" << m[0][i] << "," << m[1][i] << "," << m[2][i] << ")"; + << tab << setw(1) << "[" + << f[0][i] << setw(1) << "," + << f[1][i] << setw(1) << "," + << f[2][i] << setw(3) << "] [" + << m[0][i] << setw(1) << "," + << m[1][i] << setw(1) << "," + << m[2][i] << setw(1) << "]"; } if (localSystem_) @@ -480,9 +476,13 @@ void Foam::forces::writeBins() forAll(lf[0], i) { file(1) - << tab - << "(" << lf[0][i] << "," << lf[1][i] << "," << lf[2][i] << ") " - << "(" << lm[0][i] << "," << lm[1][i] << "," << lm[2][i] << ")"; + << tab << setw(1) << "[" + << lf[0][i] << setw(1) << "," + << lf[1][i] << setw(1) << "," + << lf[2][i] << setw(3) << "] [" + << lm[0][i] << setw(1) << "," + << lm[1][i] << setw(1) << "," + << lm[2][i] << setw(1) << "]"; } } diff --git a/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C b/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C index 5deb9e884d2e5a84fe866ad381582126ef19f06d..f79a7beb790c4191beb92998e9dfc42e0bc9b079 100644 --- a/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C +++ b/src/postProcessing/functionObjects/utilities/DESModelRegions/DESModelRegions.C @@ -42,9 +42,11 @@ defineTypeNameAndDebug(DESModelRegions, 0); void Foam::DESModelRegions::writeFileHeader(const label i) { - file() << "# DES model region coverage (% volume)" << nl - << "# time " << token::TAB << "LES" << token::TAB << "RAS" - << endl; + writeHeader(file(), "DES model region coverage (% volume)"); + + writeCommented(file(), "Time"); + writeTabbed(file(), "LES"); + writeTabbed(file(), "RAS"); } @@ -206,8 +208,10 @@ void Foam::DESModelRegions::write() if (Pstream::master() && log_) { - file() << obr_.time().timeName() << token::TAB - << prc << token::TAB << 100.0 - prc << endl; + file() << obr_.time().value() + << token::TAB << prc + << token::TAB << 100.0 - prc + << endl; } if (log_) diff --git a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C index 88b48d2e1368880a26c4235a9f60b511c6f73ac5..30f4f34ff8d2ff46f14294237b9a83334feb927a 100644 --- a/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C +++ b/src/postProcessing/functionObjects/utilities/wallShearStress/wallShearStress.C @@ -43,9 +43,11 @@ defineTypeNameAndDebug(wallShearStress, 0); void Foam::wallShearStress::writeFileHeader(const label i) { // Add headers to output data - file() << "# Wall shear stress" << nl - << "# time " << token::TAB << "patch" << token::TAB - << "min" << token::TAB << "max" << endl; + writeHeader(file(), "Wall shear stress"); + writeCommented(file(), "Time"); + writeTabbed(file(), "patch"); + writeTabbed(file(), "min"); + writeTabbed(file(), "max"); } @@ -73,9 +75,11 @@ void Foam::wallShearStress::calcShearStress if (Pstream::master()) { - file() << mesh.time().timeName() << token::TAB - << pp.name() << token::TAB << minSsp - << token::TAB << maxSsp << endl; + file() << mesh.time().value() + << token::TAB << pp.name() + << token::TAB << minSsp + << token::TAB << maxSsp + << endl; } if (log_) diff --git a/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C b/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C index 32c9043058254eb31d11491bdfe3c00e00dd08ed..acad1aef703db507563343d4d9fa9341a33bb6ea 100644 --- a/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C +++ b/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C @@ -44,10 +44,13 @@ defineTypeNameAndDebug(yPlusLES, 0); void Foam::yPlusLES::writeFileHeader(const label i) { - file() << "# y+ (LES)" << nl - << "# time " << token::TAB << "patch" << token::TAB - << "min" << token::TAB << "max" << token::TAB << "average" - << endl; + writeHeader(file(), "y+ (LES)"); + + writeCommented(file(), "Time"); + writeTabbed(file(), "patch"); + writeTabbed(file(), "min"); + writeTabbed(file(), "max"); + writeTabbed(file(), "average"); } @@ -100,10 +103,12 @@ void Foam::yPlusLES::calcIncompressibleYPlus if (Pstream::master()) { - file() << obr_.time().value() << token::TAB - << currPatch.name() << token::TAB - << minYp << token::TAB << maxYp << token::TAB - << avgYp << endl; + file() << obr_.time().value() + << token::TAB << currPatch.name() + << token::TAB << minYp + << token::TAB << maxYp + << token::TAB << avgYp + << endl; } } } @@ -166,10 +171,12 @@ void Foam::yPlusLES::calcCompressibleYPlus if (Pstream::master()) { - file() << obr_.time().value() << token::TAB - << currPatch.name() << token::TAB - << minYp << token::TAB << maxYp << token::TAB - << avgYp << endl; + file() << obr_.time().value() + << token::TAB << currPatch.name() + << token::TAB << minYp + << token::TAB << maxYp + << token::TAB << avgYp + << endl; } } } diff --git a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C index 9b5d2eca6c030f9ae439d178a8300376bfb9fb14..610cc28bbfaec51eadd8e16827e972442e17d930 100644 --- a/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C +++ b/src/postProcessing/functionObjects/utilities/yPlusRAS/yPlusRAS.C @@ -46,10 +46,13 @@ defineTypeNameAndDebug(yPlusRAS, 0); void Foam::yPlusRAS::writeFileHeader(const label i) { - file() << "# y+ (RAS)" << nl - << "# time " << token::TAB << "patch" << token::TAB - << "min" << token::TAB << "max" << token::TAB << "average" - << endl; + writeHeader(file(), "y+ (RAS)"); + + writeCommented(file(), "Time"); + writeTabbed(file(), "patch"); + writeTabbed(file(), "min"); + writeTabbed(file(), "max"); + writeTabbed(file(), "average"); } @@ -95,10 +98,12 @@ void Foam::yPlusRAS::calcIncompressibleYPlus if (Pstream::master()) { - file() << obr_.time().value() << token::TAB - << nutPw.patch().name() << token::TAB - << minYp << token::TAB << maxYp << token::TAB - << avgYp << endl; + file() << obr_.time().value() + << token::TAB << nutPw.patch().name() + << token::TAB << minYp + << token::TAB << maxYp + << token::TAB << avgYp + << endl; } } } @@ -153,10 +158,12 @@ void Foam::yPlusRAS::calcCompressibleYPlus if (Pstream::master()) { - file() << obr_.time().value() << token::TAB - << mutPw.patch().name() << token::TAB - << minYp << token::TAB << maxYp << token::TAB - << avgYp << endl; + file() << obr_.time().value() + << token::TAB << mutPw.patch().name() + << token::TAB << minYp + << token::TAB << maxYp + << token::TAB << avgYp + << endl; } } } diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/controlDict b/tutorials/incompressible/simpleFoam/motorBike/system/controlDict index 553c603b445da3b5b018fb13da13561d256fb82c..3bde7dac61d5b3752317aff2ffda4aab2148de96 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/controlDict +++ b/tutorials/incompressible/simpleFoam/motorBike/system/controlDict @@ -23,7 +23,7 @@ libs application simpleFoam; -startFrom latestTime; +startFrom startTime; // latestTime; startTime 0; diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/forceCoeffs b/tutorials/incompressible/simpleFoam/motorBike/system/forceCoeffs index 1d62bff73acde8efe3df7bf8ef5b448bfd7aa775..e308215f26466bed8e3535cb1a03012332e8ea09 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/forceCoeffs +++ b/tutorials/incompressible/simpleFoam/motorBike/system/forceCoeffs @@ -8,7 +8,8 @@ forceCoeffs1 { - type forceCoeffs; +// type forceCoeffs; + type forces; functionObjectLibs ( "libforces.so" );