35 namespace regionModels
43 void Foam::regionModels::regionModel1D::constructMeshObjects()
65 void Foam::regionModels::regionModel1D::initialise()
69 Pout<<
"regionModel1D::initialise()" <<
endl;
74 DynamicList<label> faceIDs;
75 DynamicList<label> cellIDs;
77 label localPyrolysisFacei = 0;
79 const polyBoundaryMesh& rbm = regionMesh().boundaryMesh();
81 forAll(intCoupledPatchIDs_, i)
83 const label patchi = intCoupledPatchIDs_[i];
84 const polyPatch& ppCoupled = rbm[patchi];
85 localPyrolysisFacei += ppCoupled.size();
88 boundaryFaceOppositeFace_.setSize(localPyrolysisFacei);
89 boundaryFaceFaces_.setSize(localPyrolysisFacei);
90 boundaryFaceCells_.setSize(localPyrolysisFacei);
92 localPyrolysisFacei = 0;
94 forAll(intCoupledPatchIDs_, i)
96 const label patchi = intCoupledPatchIDs_[i];
97 const polyPatch& ppCoupled = rbm[patchi];
98 forAll(ppCoupled, localFacei)
100 label facei = ppCoupled.start() + localFacei;
105 label ownCelli = regionMesh().faceOwner()[facei];
106 if (ownCelli != celli)
112 celli = regionMesh().faceNeighbour()[facei];
115 cellIDs.append(celli);
116 const cell& cFaces = regionMesh().cells()[celli];
117 faceIDs.append(facei);
119 cFaces.opposingFaceLabel(facei, regionMesh().faces());
121 }
while (regionMesh().isInternalFace(facei));
123 boundaryFaceOppositeFace_[localPyrolysisFacei] = facei;
126 boundaryFaceFaces_[localPyrolysisFacei].transfer(faceIDs);
127 boundaryFaceCells_[localPyrolysisFacei].transfer(cellIDs);
129 localPyrolysisFacei++;
138 surfaceScalarField::Boundary& nMagSfBf = nMagSf.boundaryFieldRef();
140 localPyrolysisFacei = 0;
142 forAll(intCoupledPatchIDs_, i)
144 const label patchi = intCoupledPatchIDs_[i];
145 const polyPatch& ppCoupled = rbm[patchi];
146 const vectorField& pNormals = ppCoupled.faceNormals();
148 nMagSfBf[patchi] = regionMesh().Sf().boundaryField()[patchi] & pNormals;
150 forAll(pNormals, localFacei)
152 const vector n = pNormals[localFacei];
153 const labelList& faces = boundaryFaceFaces_[localPyrolysisFacei++];
159 const label faceID = faces[facei];
160 nMagSf[faceID] = regionMesh().Sf()[faceID] &
n;
185 moveMesh_.readIfPresent(
"moveMesh", coeffs_);
197 const scalar minDelta
213 label totalFacei = 0;
214 forAll(intCoupledPatchIDs_, localPatchi)
216 label patchi = intCoupledPatchIDs_[localPatchi];
221 const labelList& faces = boundaryFaceFaces_[totalFacei];
223 const label oFace = boundaryFaceOppositeFace_[totalFacei];
233 oldCf[i] = regionMesh().faceCentres()[faces[i]];
236 oldCf[faces.size()] = regionMesh().faceCentres()[oFace];
240 const label celli =
cells[i];
242 if (
mag(oldCf[i + 1] - oldCf[i]) < minDelta)
245 cellMoveMap[celli] = 1;
254 const label celli =
cells[i];
255 newDelta[j+1] = (deltaV[celli]/
mag(sf))*
n + newDelta[j];
261 const label facei = faces[i];
262 const face f = regionMesh().faces()[facei];
268 const label pointi =
f[pti];
272 + newDelta[newDelta.size() - 1 - i];
282 regionMesh().movePoints(newPoints);
290 Foam::regionModels::regionModel1D::regionModel1D
293 const word& regionType
297 boundaryFaceFaces_(),
298 boundaryFaceCells_(),
299 boundaryFaceOppositeFace_(),
306 Foam::regionModels::regionModel1D::regionModel1D
309 const word& regionType,
310 const word& modelName,
315 boundaryFaceFaces_(regionMesh().nCells()),
316 boundaryFaceCells_(regionMesh().nCells()),
317 boundaryFaceOppositeFace_(regionMesh().nCells()),
324 constructMeshObjects();
328 moveMesh_.readIfPresent(
"moveMesh", coeffs_);
334 Foam::regionModels::regionModel1D::regionModel1D
337 const word& regionType,
338 const word& modelName,
344 boundaryFaceFaces_(regionMesh().nCells()),
345 boundaryFaceCells_(regionMesh().nCells()),
346 boundaryFaceOppositeFace_(regionMesh().nCells()),
353 constructMeshObjects();
357 moveMesh_.readIfPresent(
"moveMesh", coeffs_);