|
[Sponsors] |
the openfoam source term and fvmatrix problem |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 5, 2014, 11:56 |
the openfoam source term and fvmatrix problem
|
#1 |
Senior Member
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 13 |
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. |
|
|
|
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 |