CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   divergence (http://www.cfd-online.com/Forums/openfoam/68880-divergence.html)

r2d2 October 5, 2009 09:27

divergence
 
Hi,
I want to create a volumeScalar field with the value for the divergence
of a quantity S*V where S is a scalar and V a vector (velocity).
For this I do

phiS = linearInterpolate(S*V)&mesh.Sf();
forAll(mesh.cells()cellI){
netFluxVol[cellI] = 0.0;
forAll(mesh.cells()[cellI],iface)
{
netFluxVol[cellI]+=phiS[iface]
}
}
Is this right?
many thanks,
Radu


All times are GMT -4. The time now is 20:59.