CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

the openfoam source term and fvmatrix problem

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By wenxu

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 5, 2014, 11:56
Default the openfoam source term and fvmatrix problem
  #1
Senior Member
 
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 13
wenxu is on a distinguished road
hi,everyone:
In the src/finitevolume/fvm/fvmSup.C,there is the code:
(1)template<class Type>
Foam::tmp<Foam::fvMatrix<Type> >
Foam::fvm::Su
(
const DimensionedField<Type, volMesh>& su,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
const fvMesh& mesh = vf.mesh();

tmp<fvMatrix<Type> > tfvm
(
new fvMatrix<Type>
(
vf,
dimVol*su.dimensions()
)
);
fvMatrix<Type>& fvm = tfvm();

fvm.source() -= mesh.V()*su.field();

return tfvm;
}

(2)template<class Type>
Foam::tmp<Foam::fvMatrix<Type> >
Foam::fvm::Sp
(
const DimensionedField<scalar, volMesh>& sp,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
const fvMesh& mesh = vf.mesh();

tmp<fvMatrix<Type> > tfvm
(
new fvMatrix<Type>
(
vf,
dimVol*sp.dimensions()*vf.dimensions()
)
);
fvMatrix<Type>& fvm = tfvm();

fvm.diag() += mesh.V()*sp.field();

return tfvm;
}

(3)template<class Type>
Foam::tmp<Foam::fvMatrix<Type> >
Foam::fvm::SuSp
(
const DimensionedField<scalar, volMesh>& susp,
const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
const fvMesh& mesh = vf.mesh();

tmp<fvMatrix<Type> > tfvm
(
new fvMatrix<Type>
(
vf,
dimVol*susp.dimensions()*vf.dimensions()
)
);
fvMatrix<Type>& fvm = tfvm();

fvm.diag() += mesh.V()*max(susp.field(), scalar(0));

fvm.source() -= mesh.V()*min(susp.field(), scalar(0))
*vf.internalField();


return tfvm;
}

The code in red colour, for the EXPLICIT the operator is "-=" from the source term of the fvmatrix. for the IMPLICIT the operator is "+=" from the the diagnal term of the fvmatrix. what that mean? i think the source term is rho*phi*V, so where is the "phi"? (i don't know the fvmatrix's diagnal and source stands for? )

And for the IMPLICIT/EXPLICIT, when susp.field() greater than zero, it is the same as the IMPLICIT, i could understand that. but when susp.field less than zero, it should be use EXPLICIT, but you know that it subtract the rho*phi*V from the source of the fvmatrix, I really confused with it....

anyone could so kind to help me, thank you in advance.
fnovo likes this.
wenxu is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Implicit source term mcdonalds OpenFOAM Programming & Development 11 November 14, 2019 09:33
Problem about fvMatrix in OpenFOAM, over volume or not yhaomin2007 OpenFOAM 1 July 6, 2015 22:11


All times are GMT -4. The time now is 12:53.