Go to the documentation of this file.
73 writeHeader(os,
"Force coefficients");
74 writeHeaderValue(os,
"liftDir", liftDir_);
75 writeHeaderValue(os,
"dragDir", dragDir_);
76 writeHeaderValue(os,
"pitchAxis", pitchAxis_);
77 writeHeaderValue(os,
"magUInf", magUInf_);
78 writeHeaderValue(os,
"lRef", lRef_);
79 writeHeaderValue(os,
"Aref", Aref_);
80 writeHeaderValue(os,
"CofR", coordSys_.origin());
82 writeCommented(os,
"Time");
83 writeTabbed(os,
"Cm");
84 writeTabbed(os,
"Cd");
85 writeTabbed(os,
"Cl");
86 writeTabbed(os,
"Cl(f)");
87 writeTabbed(os,
"Cl(r)");
98 writeHeader(os, header);
99 writeHeaderValue(os,
"bins", nBin_);
100 writeHeaderValue(os,
"start", binMin_);
101 writeHeaderValue(os,
"delta", binDx_);
102 writeHeaderValue(os,
"direction", binDir_);
105 writeCommented(os,
"x co-ords :");
108 binPoints[pointI] = (binMin_ + (pointI + 1)*binDx_)*binDir_;
109 os <<
tab << binPoints[pointI].x();
113 writeCommented(os,
"y co-ords :");
116 os <<
tab << binPoints[pointI].y();
120 writeCommented(os,
"z co-ords :");
123 os <<
tab << binPoints[pointI].z();
128 writeCommented(os,
"Time");
130 for (
label j = 0; j < nBin_; j++)
133 writeTabbed(os,
jn +
"total");
134 writeTabbed(os,
jn +
"pressure");
135 writeTabbed(os,
jn +
"viscous");
139 writeTabbed(os,
jn +
"porous");
156 scalar total = pressure + viscous + porous;
163 <<
"viscous: " << viscous;
181 os << obr_.time().value();
183 for (
label binI = 0; binI < nBin_; binI++)
185 scalar total = coeffs[0][binI] + coeffs[1][binI] + coeffs[2][binI];
187 os <<
tab << total <<
tab << coeffs[0][binI] <<
tab << coeffs[1][binI];
191 os <<
tab << coeffs[2][binI];
206 const bool loadFromFiles,
261 const fvMesh&
mesh = refCast<const fvMesh>(obr_);
269 fieldName(
"forceCoeff"),
280 obr_.store(tforceCoeff.
ptr());
288 fieldName(
"momentCoeff"),
299 obr_.store(tmomentCoeff.
ptr());
315 scalar
pDyn = 0.5*rhoRef_*magUInf_*magUInf_;
323 momentCoeffs[i].
setSize(nBin_);
334 momentCoeffs[i] = (moment_[i] & pitchAxis_)/(Aref_*
pDyn*lRef_);
336 liftCoeffs[i] = (force_[i] & liftDir_)/(Aref_*
pDyn);
338 CmTot +=
sum(momentCoeffs[i]);
340 ClTot +=
sum(liftCoeffs[i]);
343 scalar ClfTot = ClTot/2.0 + CmTot;
344 scalar ClrTot = ClTot/2.0 - CmTot;
347 <<
type() <<
" " << name_ <<
" output:" <<
nl
348 <<
" Coefficients" <<
nl;
350 writeIntegratedData(
"Cm", momentCoeffs);
352 writeIntegratedData(
"Cl", liftCoeffs);
355 <<
" Cl(f) : " << ClfTot <<
nl
356 <<
" Cl(r) : " << ClrTot <<
nl
361 writeTime(coeffFilePtr_());
363 <<
tab << CmTot <<
tab << CdTot
373 for (
label binI = 1; binI < nBin_; binI++)
375 liftCoeffs[i][binI] += liftCoeffs[i][binI-1];
377 momentCoeffs[i][binI] += momentCoeffs[i][binI-1];
383 writeBinData(liftCoeffs, ClBinFilePtr_());
384 writeBinData(momentCoeffs, CmBinFilePtr_());
390 setResult(
"Cm", CmTot);
391 setResult(
"Cd", CdTot);
392 setResult(
"Cl", ClTot);
393 setResult(
"Cl(f)", ClfTot);
394 setResult(
"Cl(r)", ClrTot);
420 forceCoeff == force/f0;
421 momentCoeff == moment/m0;
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
A class for handling words, derived from string.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
#define forAll(list, i)
Loop across all elements in list.
A class for managing temporary objects.
bool read(const char *, int32_t &)
dimensionedScalar jn(const int n, const dimensionedScalar &ds)
label nBin_
Number of bins.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void writeIntegratedHeader(const word &header, Ostream &os) const
Write header for integrated data.
virtual void read(const dictionary &)
Read the forces data.
autoPtr< multiphaseSystem::dragCoeffFields > dragCoeffs(fluid.dragCoeffs())
const dimensionSet dimForce
This function object reads fields from the time directories and adds them to the mesh database for fu...
Registry of regIOobjects.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
void writeBinHeader(const word &header, Ostream &os) const
Write header for binned data.
Istream and Ostream manipulators taking arguments.
virtual void end()
Execute at the final time-loop, currently does nothing.
volScalarField pDyn(IOobject("pDyn", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, dimensionedScalar("zero", dimPressure, 0.0))
void writeIntegratedData(const word &title, const List< Field< scalar > > &coeff) const
Write integrated data.
A list of keyword definitions, which are a keyword followed by any number of values (e....
void createFiles()
Create the output files.
virtual ~forceCoeffs()
Destructor.
Generic dimensioned Type class.
Mesh data needed to do the Finite Volume discretisation.
virtual void calcForcesMoment()
Calculate the forces and moments.
T * ptr() const
Return tmp pointer for reuse.
autoPtr< OFstream > coeffFilePtr_
Integrated coefficients.
bool writeToFile() const
Return true if can write to file.
autoPtr< OFstream > CdBinFilePtr_
Drag coefficient.
virtual void write()
Write the forces.
This function object calculates the forces and moments by integrating the pressure and skin-friction ...
void setSize(const label)
Reset size of List.
virtual autoPtr< OFstream > createFile(const word &name) const
Return an autoPtr to a new file.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
forceCoeffs(const forceCoeffs &)
Disallow default bitwise copy construct.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
virtual void execute()
Execute, currently does nothing.
autoPtr< OFstream > ClBinFilePtr_
Lift coefficient.
virtual void read(const dictionary &)
Read the forces data.
const Time & time() const
Return the top-level database.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Generic GeometricField class.
autoPtr< OFstream > CmBinFilePtr_
Moment coefficient.
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
void writeBinData(const List< Field< scalar > > coeffs, Ostream &os) const
Write binned data.