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

Advection with three terms in VOF

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Tobermory

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 9, 2024, 09:29
Default Advection with three terms in VOF
  #1
New Member
 
Join Date: Apr 2023
Posts: 9
Rep Power: 3
elBombastico is on a distinguished road
Dear Foamers,

I am modelling the simultaneous transport of several passive scalars over a phase field. Because of this, the advection term of the transport equation reads as follows:

\nabla (\alpha \overrightarrow{U} \Psi),


where alpha is the phase field (scalar), U is the velocity field (vector) and Psi is the quantity being transported (scalar). Since both alpha and Psi vary on the space, it seems to me that this term should be written as:

\nabla (\alpha \overrightarrow{U} \Psi) = \Psi \overrightarrow{U} \cdot grad(\alpha) + \alpha \Psi div(\overrightarrow{U}) + \alpha \overrightarrow{U} \cdot grad(\Psi).


Since the flow is incompressible, I have implemented it in openFoam the following way:


Code:
 (Psi * U & fvc::grad(alpha)) 
  + alpha * Psi * fvc::div(phi)
   + (alpha * U & fvc::grad(Psi))
For the term that requires the divergence of the velocity field, I have used fvc::div(phi), where phi is the product of the velocity times the area at the cell faces, since, as far as I know:


\nabla \cdot \overrightarrow{U} = \frac{1}{V} \sum_{i}^{nFaces} u_{i} s_i

where u_i would be the velocity through each face and s_i, the surface of the face.

So far, it compiles and runs without complaining. Does anybody know if this would be correct and/or if there is a more efficient way of doing it?

Regards and thanks in advance
elBombastico is offline   Reply With Quote

Old   January 10, 2024, 08:59
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 696
Rep Power: 14
Tobermory will become famous soon enough
The problem that I see with you expanding out the convection term into your three terms is that the three terms are not in a conservative form. This means that when you integrate them over a cell volume, as is required for the finite volume approach, you don't get simple expressions based on the average cell value or the average face value ... By contrast, with the single convection term, you can convert the divergence into a sum of fluxes on the cell face, with face averaged values of psi, U and alpha ... and this is second order accurate if you assume a linear variation of values across a face/cell (which is the underpinning of the FV approach).

Indeed, if you expand out the Taylor series for your approach, you'll probably find that your version includes a bunch of additional cross terms and is not equivalent to the "correct" implementation using the single term.

So in short - whilst you can do it this way (in the sense that it compiles), I wouldn't recommend it. I hope that helps.
hjasak and NotOverUnderated like this.
Tobermory is offline   Reply With Quote

Old   January 10, 2024, 09:44
Default
  #3
New Member
 
Join Date: Apr 2023
Posts: 9
Rep Power: 3
elBombastico is on a distinguished road
Hi,


Thanks for your response. As you correctly guessed, the implementation with the expansion does not work - it blows up after a few time steps. After some tests, the reason is most likely the advective term, so I dropped the expansion.
First, I calculate the face fluxes of U times alpha the following way:

Code:
surfaceScalarField uAlpha
(
    IOobject
    (
        "uAlpha",
        runTime.timeName(),
        mesh,
        IOobject::READ_IF_PRESENT,
        IOobject::AUTO_WRITE
    ),
    linearInterpolate(alpha*U) & mesh.Sf()
);
and then, the divergence term as:

Code:
fvm::div(uAlpha,Psi)
But it blows up as well....
Do you happen to have any other suggestion?

Thanks in advance
elBombastico is offline   Reply With Quote

Old   January 11, 2024, 04:07
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 696
Rep Power: 14
Tobermory will become famous soon enough
I am not very conversant with VoF type solvers (for example - should there not be a density term in the divergence as well? probably my ignorance ...), but could you not simply multiply alpha and psi since they are both volScalarFields, and then just write a conventional divergence as div(phi,alphaPsi) or am I missing something?
Tobermory is offline   Reply With Quote

Old   January 11, 2024, 11:18
Default
  #5
New Member
 
Join Date: Apr 2023
Posts: 9
Rep Power: 3
elBombastico is on a distinguished road
Hi,


I have now tried multiple approaches, with different, yet disappointing results...

  1. With the approach from my previous post, the divergence is calculated as
    Code:
     uAlpha = linearInterpolate(alpha*U) & mesh.Sf()
    , and then
    Code:
    fvm::div(uAlpha,Psi)
    . The simulation blows up, unless I use a bounded discretization scheme for the advective term. With "bounded Gauss upwind", the simulation converges, but the scalar leaks through the interface, which is not supposed to. I am now trying to determine whether this is an issue caused by numerical diffusion of the upwind scheme, a mesh that is too coarse, or by the velocity or phase fields not being appropriately resolved. Any other discretization scheme causes the simulation to blow out, or the scalar values to become unbounded beyond acceptable.
  2. Your suggestion, which consists on creating a new volScalarField alphaPsi = alpha * Psi requires to specify the boundary conditions, as well as the initial values of the new volScalarField alphaPsi, or otherwise openFoam complains about the calculated BC not being applicable to that variable. I tried to do that, and resulted in the simulation blowing out as well .
It appears I am out of luck for today. I will try with a finer mesh and see what happens.
Thanks anyway for your suggestion. It was worth a shot
elBombastico is offline   Reply With Quote

Reply

Tags
divergence, gradient, interfoam


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
Difference of definition between HEM and VOF models shipman OpenFOAM 1 February 16, 2014 13:48
Question in definition of terms in solve titio OpenFOAM Running, Solving & CFD 0 March 19, 2009 16:02
ATTENTION!! Validty of Fluent's VOF?? ozgur FLUENT 1 February 18, 2004 11:59
Difficult BCs about Freesurface Simulation by VOF Yongguang Cheng FLUENT 0 September 19, 2003 07:39
K-Epsilon model? Brindaban Ghosh Main CFD Forum 2 June 24, 2000 04:22


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