CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Could someone explain the implementation of the convection scheme (http://www.cfd-online.com/Forums/openfoam-solving/59217-could-someone-explain-implementation-convection-scheme.html)

 liuhuafei January 20, 2008 20:18

It seems that something wrong

It seems that something wrong with the implementation of the convection scheme. I guess the face value is based on the following formula

&Phi;f =&Phi;C +(xf &ndash; xC) *&psi;(rf) * (d&Phi;/ dx)f
Or
&Phi;f =&Phi;C +(xf &ndash; xC) / (xD&ndash; xC) *&psi;(rf) * (&Phi;D-&Phi;C)

f ,the face
C,central node
D downwind node
&psi;(rf) the flux limiter

rf is based on the following formula
rf=(&Phi;C-&Phi;U)/( &Phi;D-&Phi;C) = 2*grad(&Phi;C)*(xD-xC) /( &Phi;D-&Phi;C) -1

so
for the faceflux mf
mf>0 &Phi;f =&Phi;P+fx*&psi;(rf) * (&Phi;N-&Phi;P)
=(1-fx*&psi;(rf)) &Phi;P +f x*&psi;(rf)* &Phi;N
mf<0 &Phi;f =&Phi;N+(1-fx)*&psi;(rf) * (&Phi;P-&Phi;N)
=(1-fx) *&psi;(rf)* &Phi;P +[1-(1-fx) *&psi;(rf)]* * &Phi;N

fx is the geometric interpolation factor, defined by fx=(xN-xf)/(xN-xP)
P is owner cell
N is neighbour cell

but in the limitedSurfaceInterpolationScheme.H and limitedSurfaceInterpolationScheme.c
template<class>
tmp<surfacescalarfield> limitedSurfaceInterpolationScheme<type>::weights
(
const GeometricField<type,>& phi
) const
{
const fvMesh& mesh = this->mesh();
tmp<surfacescalarfield> tWeights(this->limiter(phi)); this is&psi;(rf)!!!!!!!
surfaceScalarField& Weights = tWeights();
const surfaceScalarField& CDweights = mesh.surfaceInterpolation::weights(); fx !!!! scalarField& pWeights = Weights.internalField();
forAll(pWeights, face){
pWeights[face] = pWeights[face]*CDweights[face]
+ (1.0 - pWeights[face])*pos(faceFlux_[face]); It is right??????
}
Maybe openfoam is based on other formula. Could you kindly explain clearly it?

 All times are GMT -4. The time now is 08:44.