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

Howto mass source in interFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By caw
  • 1 Post By pbohorquez

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 23, 2008, 07:48
Default Dear Foamers, i would like
  #1
caw
Member
 
Christian Winkler
Join Date: Mar 2009
Location: Mannheim, Germany
Posts: 63
Rep Power: 17
caw is on a distinguished road
Dear Foamers,

i would like to calculate a growing bubble with interFoam. So far nothing spectacular. I would like to let the bubble grow simply by adding a mass source term within the bubble.

In principle that would be done by adding a source term to the continuity equation
ddt(rho) + div(rho,U)= mass_source * gamma
Unfortunatly the continuity is not solved that way in interFoam.


Is there anyone out there who has done something like this (adding mass sources to any solver?), or anybody who could give me a good hint?

Thanks in advance
best regards
Christian
Mahmoud_aboukhedr likes this.
caw is offline   Reply With Quote

Old   April 23, 2008, 12:54
Default Dear Christian, The continu
  #2
Member
 
Patricio Bohorquez
Join Date: Mar 2009
Location: Jaén, Spain
Posts: 95
Rep Power: 17
pbohorquez is on a distinguished road
Dear Christian,

The continuity equation used by interFoam, Eq. (4.3) in Rusche (2002), is div(U) = 0. We do not use div(rho)+div(rho,U) = 0 because the free-surface is expected to be a thin interface.

Thus, the equation you want to solve now reads

div(U) = mass_source*gamma/rho

The PISO-Loop should then be reformulated according to the equation shown above. Have a look, for instance, to Rusche (2002, Section 4.2.4) and Jasak (2006, Section 10.4.1): "A revised formulation of the pressure equation via a Schur's complement yields" ...

fvScalarMatrix pdEqn(
fvm::laplacian(rUAf, pd) == fvc::div(phi) - mass_source*gamma/rho );

Be careful with the numerical treatment of the source term on the r.h.s.

All the best,
Patricio

Rusche, H., 2002. Computational fluid dynamics of dispersed two-phase flows at high phase fractions. Ph.D. thesis, Imperial College, University of London.

Jasak, H., 2006. Numerical solution algorithms for compressible flows: Lecture Notes. University of Zagreb, Croatia.
tom_flint2012 likes this.
pbohorquez is offline   Reply With Quote

Old   April 25, 2008, 03:06
Default Dear Patricio, thanks for p
  #3
caw
Member
 
Christian Winkler
Join Date: Mar 2009
Location: Mannheim, Germany
Posts: 63
Rep Power: 17
caw is on a distinguished road
Dear Patricio,

thanks for pointing me into the right direction. I allready thought that i would have to modify the pressure equation. This is done for now and works.

The problem this causes is that gamma stays conservative. That is because gamma is calculated based on the face flux from last timestep and therefore changes over time. What follows is that the mass within the system stays constant which it should not because there is a mass source term. If i use a mass sink i can even cause gamma to grow greater than one ;-)

Therefore i have to add the mass source to the gamma equation as well. When i have found a convenient way to do this, i will post the solution.

Kind regards
Christian
caw is offline   Reply With Quote

Old   April 25, 2008, 12:55
Default I don't know if the info that
  #4
Member
 
Patricio Bohorquez
Join Date: Mar 2009
Location: Jaén, Spain
Posts: 95
Rep Power: 17
pbohorquez is on a distinguished road
I don't know if the info that follows will help or work?

I agree with you. We are adding mass corresponding to the gamma-phase, so the mass source should be added not only to the mixture continuity equation but to the gamma-phase continuity equation by itself.

In this line the gammaEqn.H file is to be updated. Presently, the key point is MULES

MULES::explicitSolve01(gamma, phi, phiGamma);

which employs the explicit solver and ensures a bounded solution in the range [0,1]. So, how to add the source term and conserve the bounded solution? If the source could be written as a divergence, it would be quite easy, because the gamma equation would read

ddt(gamma) + div(phi, gamma) + div(phirg, gamma) + div(source/gamma, gamma) == 0

and therefore the fluxes used by MULES could be readily modified to include the gamma-source.

Otherwise, we can use the alternative

MULES::explicitSolve01
(
volScalarField& psi,
const surfaceScalarField& phi,
surfaceScalarField& phiPsi,
const SpType& Sp,
const SuType& Su
);

which accepts source terms in the gamma equation.

Hope your code works.
Patricio
pbohorquez is offline   Reply With Quote

Old   April 29, 2008, 10:28
Default Hi all, i have a problem;i ne
  #5
Member
 
davey david
Join Date: Mar 2009
Posts: 54
Rep Power: 17
suredross is on a distinguished road
Hi all,
i have a problem;i need to add the laplace equation to my solver because i need to solve for electric potential(fields) in particular regions of my mesh.i tried doing it as before(i.e like adding a source term to a code)but i am getting error messages all the while.can anyone please help out here?

thanks in advance

davey
suredross is offline   Reply With Quote

Old   June 24, 2009, 12:57
Default
  #6
Senior Member
 
isabel
Join Date: Apr 2009
Location: Spain
Posts: 171
Rep Power: 17
isabel is on a distinguished road
Dear Pbohorquez,

Thanks for your explanation about how to add a source to the gamma equation. The problem is that I don´t understand very well.
I am working with interFoam solver. In gammaEqn.H I want to add a source. I must modify the line:

MULES::explicitSolve(gamma,phi,phiGamma,1,0)

I don´t know how to solve the equation:

ddt(gamma) + div(phi, gamma) == user_source

isabel is offline   Reply With Quote

Old   July 16, 2009, 07:59
Default
  #7
Senior Member
 
isabel
Join Date: Apr 2009
Location: Spain
Posts: 171
Rep Power: 17
isabel is on a distinguished road
There is other way to add a source to the gamma equation: in the solver interPhaseChangeFoam, the gammaEqn.H is:

volScalarField Sp
(
IOobject
(
"Sp",
runTime.timeName(),
mesh
),
vDotvAlphal - vDotcAlphal
);
volScalarField Su
(
IOobject
(
"Su",
runTime.timeName(),
mesh
),
divU*gamma
+ vDotcAlphal
);

MULES::implicitSolve(oneField(), gamma, phi, phiGamma, Sp, Su, 1, 0);


where:
gamma is the actual value to be solved
phi is the normal convective flux
phiGamma = gamma*(1-gamma)*U
Sp is the implicit source term
Su is the divergence term


My doubt is: What divergence term Su means? Divergence of what?






isabel 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
InterFoam mass conservation question msrinath80 OpenFOAM Running, Solving & CFD 5 December 9, 2013 02:19
mass source and mass sink for multi-component frank CFX 0 May 14, 2008 12:55
Mass sink and mass source in eulerTwoPhase application newbee OpenFOAM Running, Solving & CFD 3 July 9, 2006 08:15
about mass source for species lu FLUENT 5 September 25, 2003 23:29
help on UDF mass source shao1 FLUENT 2 July 11, 2002 21:36


All times are GMT -4. The time now is 06:24.