CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

fvmDdt, fvcDdt, fvm and fvc - differences

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   March 28, 2015, 16:58
Default fvmDdt, fvcDdt, fvm and fvc - differences
Senior Member
Join Date: Jun 2011
Posts: 162
Rep Power: 8
gaza is on a distinguished road
Hi Foamers,

I am studying interPhaseChangeFoam (OF 2.3.0 version), basically alphaEqn.H

I found something like this:

fvScalarMatrix alpha1Eqn (

+ fv::gaussConvectionScheme<scalar>
upwind<scalar>(mesh, phi)
).fvmDiv(phi, alpha1)

My questions are:

1) Does fvEulerDdtScheme<scalar>(mesh).fvmDdt(alpha1) mean time derivative of the alpha1? \frac{\partial \alpha}{\partial t}
if yes

2) why we use this form (I have not seen this yet) and why we don't

write just fvm::ddt(alpha1) ??

3) I know that fvm returns fvMatrix and fvc returns GeometricField, but

when should I use fvm:dt and when fvc:dt and when the form fvmDdt?

I searched on the forum but there are only information on differences between fvm and fvc. Nothing about the 3rd form fvmDdt.

I have also looked into EulerDdtScheme class but I haven't found the answers.
best regards
gaza is offline   Reply With Quote

Old   March 30, 2015, 03:51
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 7
kebsiali is on a distinguished road
fvm:dt is used for the variable you want to discretize
and fvc:dt is used to calculate the Ddt and put it in the right hand side when solving.

an example in the momentum equation you have v as a variable but also you have the pressure; to decouple the variables you use fvm:dt(rho, v) to discretize the velocity and you iterate through the pressure assuming you know it, i.e., you use fvc:: with the pressure (not fvc:dt, but with the gradient term).

fvmDdt however, is a specific method that is used here, in other words it is defined in the library which is specificly used for interPhaseChangeFoam
if you want to know where it is defined (I dont really know), you can try doing something stupid like calling it with two inputs like


This way the terminal will tell you that a specific funciton in a specific file did not appreciate two inputs, it will tell you which file and what line. go there and see how it was defined
kebsiali is offline   Reply With Quote

Old   March 30, 2015, 16:52
Senior Member
Join Date: Jun 2011
Posts: 162
Rep Power: 8
gaza is on a distinguished road
Hi kebsiali,
Thank you for your replay. It gave me better explanation for fvm and fvc.
I found that in EulerDdtScheme.C file, the fvmDdt method is defined as follows:

329 template<class Type> 330 tmp<fvMatrix<Type> >
331 EulerDdtScheme<Type>::fvmDdt
332 (
333 const GeometricField<Type, fvPatchField, volMesh>& vf
334 )
335 {
336 tmp<fvMatrix<Type> > tfvm
337 (
338 new fvMatrix<Type>
339 (
340 vf,
341 vf.dimensions()*dimVol/dimTime
342 )
343 );
345 fvMatrix<Type>& fvm = tfvm();
347 scalar rDeltaT = 1.0/mesh().time().deltaTValue();
349 fvm.diag() = rDeltaT*mesh().Vsc();
351 if (mesh().moving())
352 {
353 fvm.source() = rDeltaT*vf.oldTime().internalField()*mesh().Vsc0();
354 }
355 else
356 {
357 fvm.source() = rDeltaT*vf.oldTime().internalField()*mesh().Vsc();
358 }
360 return tfvm;
361 }

However in fvmDdt.C file, there is defined fvm::ddt method as follows:

43 template<class Type> 44 tmp<fvMatrix<Type> >
45 ddt
46 (
47 const GeometricField<Type, fvPatchField, volMesh>& vf
48 )
49 {
50 return fv::ddtScheme<Type>::New
51 (
52 vf.mesh(),
53 vf.mesh().ddtScheme("ddt(" + + ')')
54 )().fvmDdt(vf);
55 }

I think that these two definitions are quaite the same (or am I wrong?).
So why do we use two forms for time derivate?
Why just don't we write fvm::ddt everywhere?
best regards
gaza is offline   Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Components of fvm and fvc operators otq OpenFOAM Running, Solving & CFD 1 January 22, 2014 04:23
what is fvm and fvc musahossein OpenFOAM 1 September 26, 2013 22:39
Usage of fvm and fvc dl6tud OpenFOAM Programming & Development 1 July 27, 2012 18:28
Questions about the fvc and fvm starboy1985 OpenFOAM Programming & Development 0 August 2, 2011 15:52
fvm vs. fvc Pascal_doran OpenFOAM Programming & Development 1 July 8, 2010 15:35

All times are GMT -4. The time now is 02:10.