55 mkDir(time().rootPath()/time().caseName()/
"fluentInterface");
58 std::ofstream fluentMeshFile
63 / time().caseName() +
".msh" 66 Info<<
"Writing Fluent Mesh" <<
endl;
69 <<
"(0 \"OpenFOAM to Fluent Mesh File\")" <<
nl <<
nl 70 <<
"(0 \"Dimension:\")" <<
nl 71 <<
"(2 3)" <<
nl <<
nl 72 <<
"(0 \"Grid dimensions:\")" <<
nl;
79 fluentMeshFile.setf(
ios::hex, ios::basefield);
90 label nFcs = nFaces();
106 fluentMeshFile.setf(
ios::hex, ios::basefield);
120 <<
p[pointi].x() <<
" " 142 fluentMeshFile <<
" ";
144 fluentMeshFile << l.
size() <<
" ";
148 fluentMeshFile << l[lI] + 1 <<
" ";
151 fluentMeshFile << nei[facei] + 1 <<
" ";
152 fluentMeshFile << own[facei] + 1 <<
std::endl;
157 label nWrittenFaces = own.size();
162 const faceUList& patchFaces = boundaryMesh()[patchi];
165 boundaryMesh()[patchi].faceCells();
171 <<
"(13 (" << patchi + 10 <<
" " << nWrittenFaces + 1
172 <<
" " << nWrittenFaces + patchFaces.
size() <<
" ";
174 nWrittenFaces += patchFaces.size();
177 if (isA<wallFvPatch>(
boundary()[patchi]))
183 isA<symmetryPlaneFvPatch>(
boundary()[patchi])
184 || isA<symmetryFvPatch>(
boundary()[patchi])
201 fluentMeshFile <<
" ";
203 fluentMeshFile << l.
size() <<
" ";
210 fluentMeshFile << l[lI] + 1 <<
" ";
213 fluentMeshFile << patchFaceCells[facei] + 1 <<
" 0" <<
std::endl;
221 <<
"(12 (1 1 " << nCells() <<
" 1 0)" <<
nl 233 int nElemPerLine = 25;
237 if (nElemPerLine == 25)
240 fluentMeshFile <<
"\n ";
243 else if (!(nElemPerLine % 5))
252 if (
cells[celli].model() == tet)
256 else if (
cells[celli].model() ==
hex)
260 else if (
cells[celli].model() == pyr)
264 else if (
cells[celli].model() == prism)
281 Info<<
"Mesh had " << nPolys <<
" polyhedrals." <<
endl;
289 fluentMeshFile <<
"(39 (1 fluid fluid-1)())" <<
std::endl;
290 fluentMeshFile <<
"(39 (2 interior interior-1)())" <<
std::endl;
296 <<
"(39 (" << patchi + 10 <<
" ";
299 if (isA<wallFvPatch>(
boundary()[patchi]))
301 fluentMeshFile <<
"wall ";
305 isA<symmetryPlaneFvPatch>(
boundary()[patchi])
306 || isA<symmetryFvPatch>(
boundary()[patchi])
309 fluentMeshFile <<
"symmetry ";
313 fluentMeshFile <<
"pressure-outlet ";
void size(const label n)
Older name for setAddressableSize.
ios_base::fmtflags setf(const ios_base::fmtflags f)
Set flags of stream.
IOstream & hex(IOstream &io)
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< cellShape > cellShapeList
List of cellShape.
UList< label > labelUList
A UList of labels.
#define forAll(list, i)
Loop across all elements in list.
static const cellModel & ref(const modelType model)
Look up reference to cellModel by enumeration. Fatal on failure.
List< face > faceList
List of faces.
vectorField pointField
pointField is a vectorField.
fluentFvMesh(const IOobject &io)
Construct from IOobject.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
UList< face > faceUList
UList of faces.
void writeFluentMesh() const
Write Fluent mesh.
messageStream Info
Information stream (stdout output on master, null elsewhere)
IOstream & dec(IOstream &io)
#define forAllReverse(list, i)
Reverse loop across all elements in list.
List< label > labelList
A List of labels.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
IOstream & scientific(IOstream &io)
virtual int precision() const =0
Get precision of output field.