|
[Sponsors] |
June 2, 2017, 23:01 |
blockCoupledScalarTransportFoam.C
|
#1 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15 |
Dear Fellows
I am trying to understand the idea behind the blockCoupledScalarTransportFoam.C available in Foam-extend 3.1 (and more recent versions). This code is supposed to solve these two equations in a coupled manner: Code:
fvScalarMatrix TEqn ( fvm::div(phi, T) - fvm::laplacian(DT, T) == alpha*Ts - fvm::Sp(alpha, T) ); TEqn.relax(); fvScalarMatrix TsEqn ( - fvm::laplacian(DTs, Ts) == alpha*T - fvm::Sp(alpha, Ts) ); TsEqn.relax(); Code:
//- Add off-diagonal terms and remove from block source forAll(d, i) { d[i](0, 1) = -alpha.value()*mesh.V()[i]; d[i](1, 0) = -alpha.value()*mesh.V()[i]; blockB[i][0] -= alpha.value()*blockX[i][1]*mesh.V()[i]; blockB[i][1] -= alpha.value()*blockX[i][0]*mesh.V()[i]; } Code:
Field<tensor2>& d = blockM.diag().asSquare(); Code:
d[i] (0,1) I suppose that each element of d has four components and (0,1) and (1,0) are the off-diagonal of each element???? Since here, i goes from 0 to 1. This part is some how, clear for me: Code:
blockB[i][0] -= alpha.value()*blockX[i][1]*mesh.V()[i]; blockB[i][1] -= alpha.value()*blockX[i][0]*mesh.V()[i]; But, would some body describe this part for me? Code:
d[i](0, 1) = -alpha.value()*mesh.V()[i]; d[i](1, 0) = -alpha.value()*mesh.V()[i]; Last edited by babakflame; June 3, 2017 at 02:13. |
|
|
|