# fvmDdt, fvcDdt, fvm and fvc - differences

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

 March 28, 2015, 16:58 fvmDdt, fvcDdt, fvm and fvc - differences #1 Senior Member   Przemek Join Date: Jun 2011 Posts: 162 Rep Power: 8 Hi Foamers, I am studying interPhaseChangeFoam (OF 2.3.0 version), basically alphaEqn.H I found something like this: fvScalarMatrix alpha1Eqn ( fvEulerDdtScheme(mesh).fvmDdt(alpha1) + fv::gaussConvectionScheme ( mesh, phi, upwind(mesh, phi) ).fvmDiv(phi, alpha1) etc.... My questions are: 1) Does fvEulerDdtScheme(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 pblasiak

 March 30, 2015, 03:51 #2 Member   ali alkebsi Join Date: Jan 2012 Location: Strasbourg, France Posts: 82 Rep Power: 7 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 fvEulerDdtScheme(mesh).fvmDdt(alpha1,v) 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

 March 30, 2015, 16:52 #3 Senior Member   Przemek Join Date: Jun 2011 Posts: 162 Rep Power: 8 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 330 tmp > 331 EulerDdtScheme::fvmDdt 332 ( 333 const GeometricField& vf 334 ) 335 { 336 tmp > tfvm 337 ( 338 new fvMatrix 339 ( 340 vf, 341 vf.dimensions()*dimVol/dimTime 342 ) 343 ); 344 345 fvMatrix& fvm = tfvm(); 346 347 scalar rDeltaT = 1.0/mesh().time().deltaTValue(); 348 349 fvm.diag() = rDeltaT*mesh().Vsc(); 350 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 } 359 360 return tfvm; 361 } However in fvmDdt.C file, there is defined fvm::ddt method as follows: 43 template 44 tmp > 45 ddt 46 ( 47 const GeometricField& vf 48 ) 49 { 50 return fv::ddtScheme::New 51 ( 52 vf.mesh(), 53 vf.mesh().ddtScheme("ddt(" + vf.name() + ')') 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 pblasiak

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post otq OpenFOAM Running, Solving & CFD 1 January 22, 2014 04:23 musahossein OpenFOAM 1 September 26, 2013 22:39 dl6tud OpenFOAM Programming & Development 1 July 27, 2012 18:28 starboy1985 OpenFOAM Programming & Development 0 August 2, 2011 15:52 Pascal_doran OpenFOAM Programming & Development 1 July 8, 2010 15:35

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