45 "p { name P; Label \"Pressure\"; units \"Pa\"; }"
50 "rho { name DENS; Label \"Density\"; units \"kg/m3\"; }"
51 "T { name T; Label \"Temperature\"; units \"K\"; }"
52 "k { name TE; Label \"Turb Kinetic Energy\"; units \"m2/s2\"; }"
53 "epsilon { name ED; Label \"Dissipation Rate\"; units \"m2/s3\"; }"
54 "mu { name LAMV; Label \"Molecular Viscosity\"; units \"Pa s\"; }"
55 "mut { name VIS; Label \"Turbulent Viscosity\"; units \"Pa s\"; }"
57 "U { name ALL; Label \"Velocity\"; units \"m/s\"; }"
59 "_0U { name SU; Label \"Velocity Component U\"; units \"m/s\"; }"
60 "_1U { name SV; Label \"Velocity Component V\"; units \"m/s\"; }"
61 "_2U { name SW; Label \"Velocity Component W\"; units \"m/s\"; }"
63 "phi { name MassFlux; Label \"Mass Flux\"; units \"kg/s\"; }"
70bool Foam::ccm::writer::newFieldNode
72 const ccmID& phaseNode,
73 const word& fieldName,
74 const dictionary& nameMapping,
75 const ccmDimension& dims,
79 if (!nameMapping.found(fieldName) || !nameMapping.isDict(fieldName))
84 const dictionary&
dict = nameMapping.
subDict(fieldName);
92 string ccmLabel(fieldName);
133 if (!isA<fvMesh>(mesh_))
136 <<
"cannot write solutions with a polyMesh instead of a fvMesh"
143 if (remappingDictName.empty())
150 mesh_.time().constant(),
168 if (remapDict.
isDict(
"fields"))
170 nameMapping |= remapDict.
subDict(
"fields");
174 ccmID stateNode, processorNode, nodeId;
180 &(globalState_->error),
181 (globalState_->root),
187 assertNoError(
"could not create default state");
206 &(globalState_->error),
212 assertNoError(
"could not create processor node");
218 nullptr, stateNode, processorNode,
231 ccmID verticesNode, topoNode;
234 &(globalState_->error),
235 (globalState_->root),
243 &(globalState_->error),
244 (globalState_->root),
250 string topoFileName = defaultMeshName +
".ccmg";
254 &(globalState_->error),
256 topoFileName.c_str(), &verticesNode,
257 topoFileName.c_str(), &topoNode,
262 assertNoError(
"Error after writing geometry processor");
266 &(globalState_->error),
267 (globalState_->root),
273 assertNoError(
"could not create Restart_1 state");
292 &(globalState_->error),
298 assertNoError(
"could not create 'Processor' node");
304 nullptr, stateNode, processorNode,
313 ccmID phaseNode, fieldSetNode;
322 (globalState_->root),
332 &(globalState_->error),
333 (globalState_->root),
338 assertNoError(
"could not create FieldSet node");
343 ccmID restartInfoNode, restartDataNode;
346 &(globalState_->error),
352 assertNoError(
"could not create restartInfoNode node");
380 CCMIOWriteRestartInfo
382 &(globalState_->error),
394 &(globalState_->error),
400 assertNoError(
"could not create restartDataNode node");
414 CCMIONewIndexedEntity
416 &(globalState_->error),
430 "Material Specific Heat",
438 "Material Molecular Weight",
443 CCMIONewIndexedEntity
445 &(globalState_->error),
455 const word fieldName = (*iter()).
name();
456 const word fieldType = (*iter()).headerClassName();
458 if (!nameMapping.
found(fieldName))
472 mesh_.time().timeName(),
477 refCast<const fvMesh>(mesh_)
502 &(globalState_->error),
511 &(globalState_->error),
517 field.primitiveField().begin()
522 assertNoError(
"writing internalField " + fieldName);
529 &(globalState_->error),
538 &(globalState_->error),
540 maps_->boundary[patchI],
544 field.boundaryField()[patchI].begin()
551 assertNoError(
"writing boundaryField " + fieldName);
562 mesh_.time().timeName(),
567 refCast<const fvMesh>(mesh_)
581 for (
direction cmpt=0; cmpt < pTraits<vector>::nComponents; ++cmpt)
586 CCMIOComponent ccmComponent = kCCMIOVectorX;
589 ccmComponent = kCCMIOVectorX;
592 ccmComponent = kCCMIOVectorY;
595 ccmComponent = kCCMIOVectorZ;
616 CCMIOWriteMultiDimensionalFieldData
618 &(globalState_->error),
627 &(globalState_->error),
636 &(globalState_->error),
642 field.primitiveField().begin()
644 kCCMIOStart, kCCMIOEnd
648 "writing internalField " + fieldName +
" " + componentName
657 &(globalState_->error),
666 &(globalState_->error),
668 maps_->boundary[patchI],
672 field.boundaryField()[patchI].begin()
674 kCCMIOStart, kCCMIOEnd
680 "writing boundaryField " + fieldName +
" " + componentName
695 mesh_.time().timeName(),
700 refCast<const fvMesh>(mesh_)
725 &(globalState_->error),
734 &(globalState_->error),
736 maps_->internalFaces,
740 field.primitiveField().cdata()
745 assertNoError(
"writing internalField " + fieldName);
752 &(globalState_->error),
761 &(globalState_->error),
763 maps_->boundary[patchI],
767 field.boundaryField()[patchI].cdata()
774 assertNoError(
"writing boundaryField " + fieldName);
780 assertNoError(
"Error before writing processor");
784 &(globalState_->error),
789 nullptr, &fieldSetNode
791 assertNoError(
"Error after writing processor");
Input/output from string buffers.
Internal bits for wrapping libccmio - do not use directly.
tmp< GeometricField< cmptType, PatchField, GeoMesh > > component(const direction) const
Return a component of the field.
Input from file stream, using an ISstream.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
List of IOobjects with searching and retrieving facilities.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
std::unique_ptr< ccmGlobalState > globalState_
Maintain overall global states (error, root-node)
void writeSolution(const IOobjectList &objects, const fileName &remappingDictName=fileName::null)
Write the solutions.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
bool isDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Check if entry is found and is a sub-dictionary.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
A class for handling file names.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
A class for handling words, derived from Foam::string.
const polyBoundaryMesh & patches
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
#define WarningInFunction
Report a warning using Foam::Warning.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Ostream & flush(Ostream &os)
Flush stream.
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
static const char *const typeName
The type name used in ensight case files.