Updated block assembly of MRF and porous zones

This commit is contained in:
Hrvoje Jasak 2017-01-09 18:46:51 +00:00
parent 4d19d7ec94
commit 3d979afaf7

View file

@ -5,6 +5,9 @@
fvc::div(phi) fvc::div(phi)
); );
// Update boundary velocity for consistency with the flux
mrfZones.correctBoundaryVelocity(U);
// Momentum equation // Momentum equation
fvVectorMatrix UEqn fvVectorMatrix UEqn
( (
@ -67,28 +70,38 @@
const scalarField& V = mesh.V().field(); const scalarField& V = mesh.V().field();
// Note: this insertion should only happen in porous cell zones // Note: insertion should only happen in porous cell zones
// A rewrite of the porousZones class interface is needed.
// HJ, 14/Mar/2016 // HJ, 14/Mar/2016
forAll (TUIn, cellI)
register label cellI;
forAll (pZones, pZoneI)
{ {
const scalar& cellV = V[cellI]; const labelList& curZoneCells = pZones[pZoneI].zone();
const tensor& cellTU = TUIn[cellI]; // Loop over all cells in the zone
forAll (curZoneCells, zcI)
{
cellI = curZoneCells[zcI];
CoeffField<vector4>::squareType& cellDD = DD[cellI]; const scalar& cellV = V[cellI];
cellDD(0, 0) += cellV*cellTU.xx(); const tensor& cellTU = TUIn[cellI];
cellDD(0, 1) += cellV*cellTU.xy();
cellDD(0, 2) += cellV*cellTU.xz();
cellDD(1, 0) += cellV*cellTU.yx(); CoeffField<vector4>::squareType& cellDD = DD[cellI];
cellDD(1, 1) += cellV*cellTU.yy();
cellDD(2, 2) += cellV*cellTU.yz();
cellDD(2, 0) += cellV*cellTU.zx(); cellDD(0, 0) += cellV*cellTU.xx();
cellDD(2, 1) += cellV*cellTU.zy(); cellDD(0, 1) += cellV*cellTU.xy();
cellDD(2, 2) += cellV*cellTU.zz(); cellDD(0, 2) += cellV*cellTU.xz();
cellDD(1, 0) += cellV*cellTU.yx();
cellDD(1, 1) += cellV*cellTU.yy();
cellDD(2, 2) += cellV*cellTU.yz();
cellDD(2, 0) += cellV*cellTU.zx();
cellDD(2, 1) += cellV*cellTU.zy();
cellDD(2, 2) += cellV*cellTU.zz();
}
} }
} }
} }