27 dynamic_cast<PPMatrix&
>(matrix.
getMatrix(pIndex,pIndex));
29 FMatrix& dFluxdP =
dynamic_cast<FMatrix&
>(matrix.
getMatrix(mfIndex,pIndex));
31 PPAssembler& ppAssembler = ppMatrix.getPairWiseAssembler(faceCells);
32 PPDiagArray& ppDiag = ppMatrix.getDiag();
37 TArray& rCell =
dynamic_cast<TArray&
>(rField[pIndex]);
38 TArray& massFlux =
dynamic_cast<TArray&
>(_flowFields.massFlux[faces]);
39 TArray& pCell =
dynamic_cast<TArray&
>(_flowFields.pressure[cells]);
40 const TArray& density =
dynamic_cast<const TArray&
>(_flowFields.density[cells]);
43 bVelocity(bc.
getVal(
"specifiedXVelocity"),
44 bc.
getVal(
"specifiedYVelocity"),
45 bc.
getVal(
"specifiedZVelocity"),
50 const bool fixPressure = (bc.
bcType ==
"FixedBoundary");
56 for(
int f=0; f<nFaces; f++)
58 const int c0 = faceCells(f,0);
59 const int c1 = faceCells(f,1);
61 massFlux[f] = density[c0]*
dot(bVelocity[f],faceArea[f]);
63 rCell[c0] -= massFlux[f];
65 netFlux += massFlux[f];
66 ppAssembler.getCoeff01(f) =0;
70 rCell[c1] = bp[f]-pCell[c1];
71 ppAssembler.getCoeff10(f) =0;
76 ppAssembler.getCoeff10(f) =1;
79 ppMatrix.setBoundary(c1);
81 dFluxdP.setCoeffL(f,T(0.));
82 dFluxdP.setCoeffR(f,T(0.));
89 dynamic_cast<VPMatrix&
>(matrix.
getMatrix(vIndex,pIndex));
91 VPAssembler& vpAssembler = vpMatrix.getPairWiseAssembler(faceCells);
92 VPDiagArray& vpDiag = vpMatrix.getDiag();
94 for(
int f=0; f<nFaces; f++)
96 const int c0 = faceCells(f,0);
97 vpDiag[c0] += vpAssembler.getCoeff01(f);
Matrix & getMatrix(const Index &rowIndex, const Index &colIndex)
bool hasMatrix(const Index &rowIndex, const Index &colIndex) const
FloatVal< T > getVal(const string varName) const
pair< const Field *, const StorageSite * > ArrayIndex
const StorageSite & getCells() const
const CRConnectivity & getFaceCells(const StorageSite &site) const
T dot(const Vector< T, 3 > &a, const Vector< T, 3 > &b)