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

fvmDdt, fvcDdt, fvm and fvc - differences

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By gaza
  • 3 Post By kebsiali

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 28, 2015, 15:58
Default fvmDdt, fvcDdt, fvm and fvc - differences
  #1
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15
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 (
fvEulerDdtScheme<scalar>(mesh).fvmDdt(alpha1)


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


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.
nepomnyi likes this.
__________________
best regards
pblasiak
gaza is offline   Reply With Quote

Old   March 30, 2015, 03:51
Default
  #2
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
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

fvEulerDdtScheme<scalar>(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
hogsonik, nepomnyi and Alpha001 like this.
kebsiali is offline   Reply With Quote

Old   March 30, 2015, 16:52
Default
  #3
Senior Member
 
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15
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 );
344
345 fvMatrix<Type>& 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<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(" + 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
gaza 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
Components of fvm and fvc operators otq OpenFOAM Running, Solving & CFD 1 January 22, 2014 03: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 10:56.