Convection Term
1 Attachment(s)
Hello Foamers,
I have modified the solver MRFInterFoam to solve the population balance equation via the Quadratic method of Moments. Now I would like to add the convection term (see attached file) m is a scalarField c1 and c2 are constants (scalars) First I tried this Equation, but I understand, that I can't calculate "scalar  tensor". Code:
fvScalarMatrix mEqn Code:
fvScalarMatrix mEqn Thanks for your help. 
Hi,
yes it is better. Don't forget to add the temporal derivative and the source term. Look at applications/solvers/basic/scalarTransportFoam. 
Thank you Thomas.
Do you mean something like that? Code:
solve 
Ok for the time derivative.
For the source term, it is not good. Ok, I assume your "c2" is a fixed variable. This way, you have 2 possibility: 1 use solve ( fvm::ddt(m) + fvm::div(phi, m)  fvm::laplacian(c1, m) == fvm::Su(c2f,m) ); ...where c2f can be declared after the m variable as follows: DimensionedField<scalar,volMesh> c2f ( IOobject ( "c2f", m.time().timeName(), m.mesh(), IOobject::NO_READ, IOobject::NO_WRITE ), m.mesh(), dimensionedScalar("c2f",m.dimensions()/dimTime,c2) ); 2 cleaner approach by using the fvOptions framework. Needs to write: solve ( fvm::ddt(m) + fvm::div(phi, m)  fvm::laplacian(c1, m) == fvOptions(m) ); In this approach, you need to define in the right way the fvOptions file located in the system file. Look at the tutorials to find the syntax you need. N.B : if c2 is not a fixed variable, the first approach is probably the simpler for first try (you could use the second one in combinaison of the codedFunctionObject) 
Thank you thomas its working

All times are GMT 4. The time now is 00:39. 