Go to the documentation of this file.
39 namespace functionObjects
47 Foam::functionObjects::Curle::modeTypeNames_
50 { modeType::surface,
"surface" },
64 writeFile(mesh_,
name),
71 surfaceWriterPtr_(nullptr)
86 dict.readIfPresent(
"p", pName_);
88 patchSet_ = mesh_.boundaryMesh().patchSet(
dict.get<
wordRes>(
"patches"));
90 if (patchSet_.empty())
93 <<
"No patches defined"
105 observerPositions_ =
dict.get<List<point>>(
"observerPositions");
108 case modeType::surface:
110 const fileName fName = (
dict.get<fileName>(
"surface")).expand();
111 inputSurface_ = MeshedSurface<face>(fName);
113 observerPositions_ = inputSurface_.Cf();
117 if (observerPositions_.empty())
120 <<
"No observer positions defined"
126 const auto outputMode = modeTypeNames_.get(
"output",
dict);
132 rawFilePtrs_.setSize(observerPositions_.size());
133 forAll(rawFilePtrs_, filei)
141 if (rawFilePtrs_.set(filei))
143 OFstream&
os = rawFilePtrs_[filei];
145 writeHeaderValue(
os,
"Observer", filei);
146 writeHeaderValue(
os,
"Position", observerPositions_[filei]);
147 writeCommented(
os,
"Time");
148 writeTabbed(
os,
"p(Curle)");
154 case modeType::surface:
159 <<
"Surface output is only available when input mode is "
160 <<
"type '" << modeTypeNames_[modeType::surface] <<
"'"
164 const word surfaceType(
dict.get<word>(
"surfaceType"));
168 dict.subOrEmptyDict(
"formatOptions").subOrEmptyDict(surfaceType)
172 surfaceWriterPtr_->useTimeDir(
true);
177 dict.readEntry(
"c0", c0_);
182 <<
"Reference speed of sound = " << c0_
183 <<
" cannot be negative or zero."
193 if (!foundObject<volScalarField>(pName_))
207 for (
auto patchi : patchSet_)
214 forAll(observerPositions_, pointi)
216 const vectorField r(observerPositions_[pointi] - Cfp);
220 sum((pp*
sqr(invMagR) + invMagR/c0_*dpdtp)*(Sfp & (r*invMagR)));
229 if (surfaceWriterPtr_)
234 surfaceWriterPtr_->beginTime(time_);
236 surfaceWriterPtr_->open
238 inputSurface_.points(),
239 inputSurface_.surfFaces(),
240 (baseFileDir()/
name()/
"surface"),
244 surfaceWriterPtr_->write(
"p(Curle)", pDash);
246 surfaceWriterPtr_->endTime();
247 surfaceWriterPtr_->clear();
252 forAll(observerPositions_, pointi)
254 if (rawFilePtrs_.set(pointi))
256 OFstream&
os = rawFilePtrs_[pointi];
257 writeCurrentTime(
os);
258 os << pDash[pointi] <<
endl;
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
A class for handling file names.
Different types of constants.
bool read(const char *buf, int32_t &val)
static bool master(const label communicator=worldComm)
Ostream & endl(Ostream &os)
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Field< vector > vectorField
Specialisation of Field<T> for vector.
Generic templated field type.
Curle(const word &name, const Time &runTime, const dictionary &dict)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
virtual bool read(const dictionary &)
errorManip< error > abort(error &err)
Output to file stream, using an OSstream.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
#define FatalErrorInFunction
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr scalar pi(M_PI)
static autoPtr< surfaceWriter > New(const word &writeType)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
string & expand(const bool allowEmpty=false)
A List of wordRe with additional matching capabilities.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
word name(const expressions::valueTypeCode typeCode)
Base class for writing single files from the function objects.
Calculate the first temporal derivative.
#define FatalIOErrorInFunction(ios)
tmp< GeometricField< Type, fvPatchField, volMesh > > ddt(const dimensioned< Type > dt, const fvMesh &mesh)
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
vector point
Point is a vector.
Generic GeometricField class.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction