CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

Meaning of fvm and fvc

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

Like Tree14Likes
  • 11 Post By tonyuprm
  • 1 Post By vkrastev
  • 2 Post By vkrastev

Reply
 
LinkBack Thread Tools Display Modes
Old   May 3, 2011, 04:01
Default Meaning of fvm and fvc
  #1
New Member
 
Nishit Joseph
Join Date: Nov 2010
Posts: 29
Rep Power: 6
JLight is on a distinguished road
Hi
I am a UG student working on a solver for high Ma numbers using OpenFOAM for my final year project. I am relatively new to OpenFOAM.

While looking at the code of rhoCentralFoam i came across this line(s) which I am not able to figure out the menaing

Code:
if (!inviscid)
        {
            volScalarField k("k", thermo.Cp()*mu/Pr);
            solve
            (
                fvm::ddt(rho, e) - fvc::ddt(rho, e)
              - fvm::laplacian(thermo.alpha(), e)
              + fvc::laplacian(thermo.alpha(), e)
              - fvc::laplacian(k, T)
            );
            thermo.correct();
            rhoE = rho*(e + 0.5*magSqr(U));
        }
What does
Code:
fvm::ddt(rho, e) - fvc::ddt(rho, e)
really mean?

I am trying to rewrite sonicFoam energy equation using total energy and since this solver uses total energy (for inviscid - not shown above) i thought I could copy it but was not sure what is happening in the above shown code to include viscous effect.

Any help or advise will be highly appreciated!

Cheers!
JLight is offline   Reply With Quote

Old   May 3, 2011, 04:13
Default
  #2
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
You can consult the User Guide or Programmer Guide in the /doc directory of your install. You will definitely find the answer to this question, and very likely of some future questions as well.
Bernhard is offline   Reply With Quote

Old   May 3, 2011, 12:09
Default
  #3
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 397
Rep Power: 12
marupio is on a distinguished road
It would be nice to see a translation guide between all the fvm / fvc functions and their equivalent vector-form calculus in the wiki somewhere. Perhaps a sub-page under: http://openfoamwiki.net/index.php/Ca...OpenFOAM_guide

Most of them are straightforward, but some are not.
marupio is offline   Reply With Quote

Old   May 4, 2011, 00:27
Default
  #4
Member
 
Tony
Join Date: Jun 2010
Posts: 54
Rep Power: 7
tonyuprm is on a distinguished road
Using "fvc::" will calculate the derivative using the current values. While "fvm::" will discretize the term into the matrix equation. So "fvc::" will generate a field, while "fvm::" will return matrix coefficients. Soo, if you're solving [M] [Q] = [B]

fvm:: generates coefficients for [M]
fvc:: goes in [B]

Its more or less a distinction between explicit and implicit terms.

Hope this helps.

gl,

Tony
tonyuprm is offline   Reply With Quote

Old   May 4, 2011, 02:35
Default
  #5
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
Quote:
Originally Posted by marupio View Post
It would be nice to see a translation guide between all the fvm / fvc functions and their equivalent vector-form calculus in the wiki somewhere. Perhaps a sub-page under: http://openfoamwiki.net/index.php/Ca...OpenFOAM_guide

Most of them are straightforward, but some are not.
See section 2.4 Equation discretisation of the Programmers Guide, it is clearly explained as you ask here.
Bernhard is offline   Reply With Quote

Old   October 12, 2011, 17:36
Default
  #6
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 361
Rep Power: 10
vkrastev is on a distinguished road
Well, in the user and programmers guides actually there is no clear explanation of what fvc::ddt means, so I think that the question posed at the beginning of the tread should be considered more seriously than "go and see it in the user/programmers" guide. Thou the meaning of other fvc terms is quite easily deducible (i. e. simply source terms calculated with available values), to me (sorry for my ignorance) it is not the same with fvc::ddt. Which are, for instance, the "available values" in this case? In addition, it is also interesting to go deeper into the rhoCentralFoam solution algorithm, which in general is not so straightforward as many others into the OF solver family.
I hope that someone else could join the discussion to share his knowledge/opinion about it.

Regards

V.
Usman15 likes this.
vkrastev is offline   Reply With Quote

Old   October 12, 2011, 23:53
Default
  #7
New Member
 
Nishit Joseph
Join Date: Nov 2010
Posts: 29
Rep Power: 6
JLight is on a distinguished road
Quote:
Originally Posted by vkrastev View Post
Well, in the user and programmers guides actually there is no clear explanation of what fvc::ddt means.....
V.
Thanks for keeping this alive.

With regards to the methods used in rhoCentralFoam, thought I wont admit I fully understand all of it, the solver from Praveen (link below) based on rhoCentralFoam did give me an insight of the intent since they were algorithms I am more used to.

http://sourceforge.net/projects/gfoam/

Regards

Nishit
JLight is offline   Reply With Quote

Old   October 13, 2011, 11:35
Default
  #8
Senior Member
 
Vesselin Krastev
Join Date: Jan 2010
Location: University of Tor Vergata, Rome
Posts: 361
Rep Power: 10
vkrastev is on a distinguished road
Well, this is what I have understood so far about the rhoCentralFoam solver.

1) In the first part of the solver, there is an explicit spatial reconstruction of some "intermediate" fields over the cell faces, using the Kurganov or Tadmor interpolation schemes;

2) after that, these "intermediate fields" are used to calculate explicit source terms for the density equation and the inviscid momentum and energy equations, which are "forwarded" in time and then solved as diagonal systems of equations;

3) if the viscosity of the fluid has been set to zero, the algorithm stops here; otherwise, the viscous (and eventually turbulent) momentum and energy equations are solved, treating the already calculated inviscid part of the equations as explicit source terms.

4) before (eventually) solving the turbulent quantities transport equations, the pressure field is updated via the equation of state of the fluid.

Some comments:

I think that fvc::ddt actually represents the source term coming from the inviscid part of the solution. Let's take, for instance, the momentum equation:

// --- Solve density
solve(fvm::ddt(rho) + fvc::div(phi));

// --- Solve momentum
solve(fvm::ddt(rhoU) + fvc::div(phiUp));

U.dimensionedInternalField() =
rhoU.dimensionedInternalField()
/rho.dimensionedInternalField();
U.correctBoundaryConditions();
rhoU.boundaryField() = rho.boundaryField()*U.boundaryField();

this part of the code solves for rho and U, assuming that in the momentum equation only pressure and convection effects occur (inviscid solution). After that the viscous momentum equation is defined and solved as follows:

if (!inviscid)
{
solve
(
fvm::ddt(rho, U) - fvc::ddt(rho, U)
- fvm::laplacian(muEff, U)
- fvc::div(tauMC)
);
rhoU = rho*U;
}

well, if one calculates ddt(rho,U) explicitly, using the initial rho and U values and the freshly calculated rho and U actual inviscid values, one should reobtain the second term of the inviscid momentum equation, i. e. the contribution of convection and pressure gradients.

Doubts and questions:

1) if I am right about my interpretation of fvc:ddt(<something>), does it mean that the effects of convection+pressure can be splitted from those of viscous diffusion? This is a little confusing to me, as the U values used in fvc:rho,U) should be approximate values if viewed as part of a viscous flow solution...

2) to me the initial "reconstruction" procedure is quite a mystery, especially for what concerns the pressure field and its introduction into the "mixed" pressure-convection term represented by fvc::div(phiUp)...

Any comments, suggestions and (of course) corrections to my statements would be really appreciated

Regards

V.
kiddmax and charmc like this.
vkrastev is offline   Reply With Quote

Reply

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
fvm vs. fvc Pascal_doran OpenFOAM Programming & Development 1 July 8, 2010 15:35


All times are GMT -4. The time now is 16:26.