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

interFoam modification for mass transfer

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 2 Post By lxufeishi
  • 1 Post By lxufeishi
  • 1 Post By Mano2903

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 27, 2021, 07:58
Default interFoam modification for mass transfer
  #1
New Member
 
Mano
Join Date: May 2019
Posts: 9
Rep Power: 7
Mano2903 is on a distinguished road
Dear Foamers,

I'm working on a project involving multi-phase flows and was tasked with plugging in a mass transfer term into the interFoam solver. After reading some literature, I found a paper by Dr. Nima Samkhaniani, where he had added a source term to the volume fraction equation, which considered mass transfer rate and I made the following modification to alphaSuSp.H file based on the same:
Code:
zeroField Sp;
zeroField divU;

volScalarField Su
(
    IOobject
    (
        "Su",
        runTime.timeName(),
        mesh
    ),
    -mdot*((1/rho1)-(alpha1*(1/rho1-1/rho2)))
);
where mdot is the mass flow rate in kg/m3s and is defined explicitly. The value is defined in a case file's /constant directory and I've assigned random values (0.005).
I made this change and compiled the solver. I ran two simulations: Rising Bubble case and Cavitation over a hydrofoil. The contours of water of the simulations are below. Could someone please explain the physics behind what's going on here and why is the contour very different from a typical interFoam contour?
mdot_0_5.jpg

0.jpg
I'm running OpenFOAM v8. Thanks in advance.
Mano2903 is offline   Reply With Quote

Old   July 3, 2021, 12:35
Default
  #2
New Member
 
Mano
Join Date: May 2019
Posts: 9
Rep Power: 7
Mano2903 is on a distinguished road
A theory as to why the "tiger stripes" appear is that since I have defined the source term explicitly in the volume fraction(alpha.water) equation, the value of the same has has changed in the entire domain.

I would really appreciate suggestions as to how I can eliminate these stripes while still keeping the source term in the equation. Thank you!
Mano2903 is offline   Reply With Quote

Old   July 12, 2021, 03:31
Default
  #3
New Member
 
Mano
Join Date: May 2019
Posts: 9
Rep Power: 7
Mano2903 is on a distinguished road
Now I wish to add mass transfer only at the interface, i.e, where 0<alpha.water<1. I've found a solution here, but the latest openfoam version does not let me modify alphaEqn.H file found in /opt/openfoam8/src/twoPhaseModels/twoPhaseMixture/VoF. And I'm not able to add "if" conditions to alphaSuSp.H file either.

Any advice would be appreciated!
Mano2903 is offline   Reply With Quote

Old   July 16, 2021, 06:44
Default
  #4
New Member
 
Join Date: Jul 2019
Location: MARS
Posts: 9
Rep Power: 7
lxufeishi is on a distinguished road
Hi Mano2903
Have you tried to define the source term in an implicit way? like:

Code:
zeroField Su;
zeroField divU;
volScalarField Sp ("Sp", (1.0/rho1 * mdot)/(alpha1 + SMALL));
And I remind you to add a source term to the mass equation as well, by modifying the pEqn.H:

Code:
fvScalarMatrix p_rghEqn
(
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA) - mdot*(1.0/rho1 - 1.0/rho2)
);
Hope this will help you.
acgnipper and Mano2903 like this.
lxufeishi is offline   Reply With Quote

Old   July 19, 2021, 16:27
Default
  #5
New Member
 
Mano
Join Date: May 2019
Posts: 9
Rep Power: 7
Mano2903 is on a distinguished road
Hi lxufeishi,

Thanks for replying!

I haven't considered implementing the mass transfer as an implicit source term yet. I look forward to implementing your code. But I have a question.
Code:
volScalarField Sp ("Sp", (1.0/rho1 * mdot)/(alpha1 + SMALL));
What does "SMALL" mean?
Mano2903 is offline   Reply With Quote

Old   July 19, 2021, 21:44
Default
  #6
New Member
 
Join Date: Jul 2019
Location: MARS
Posts: 9
Rep Power: 7
lxufeishi is on a distinguished road
SMALL is a constant already defined in src/OpenFOAM/primitives/Scalar/scalar/scalar.H and it is used here to prevent from dividing by 0.

Code:
GREAT = 1.0e+6;
VGREAT = 1.0e+37;
ROOTVGREAT = 1.0e+18;
SMALL = 1.0e-6;
VSMALL = 1.0e-37;
ROOTVSMALL = 1.0e-18;
Mano2903 likes this.
lxufeishi is offline   Reply With Quote

Old   July 30, 2021, 11:53
Default
  #7
New Member
 
Mano
Join Date: May 2019
Posts: 9
Rep Power: 7
Mano2903 is on a distinguished road
Quote:
Originally Posted by lxufeishi View Post
Code:
zeroField Su;
zeroField divU;
volScalarField Sp ("Sp", (1.0/rho1 * mdot)/(alpha1 + SMALL));
Code:
fvScalarMatrix p_rghEqn
(
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA) - mdot*(1.0/rho1 - 1.0/rho2)
);
Hi lxufeishi,

Update: The implicit method worked! Thank you.

Could you help me understand, how the Su and Sp implementation vary and why?

Regards,
Mano2903
erinsam likes this.
Mano2903 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
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 92 May 21, 2024 08:56
Mass transfer interaction and DPM attaullah Fluent Multiphase 0 February 24, 2017 11:34
Error - Solar absorber - Solar Thermal Radiation MichaelK CFX 12 September 1, 2016 06:15
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 16:55
additional variable mass transfer in CFX5.6 john CFX 1 February 14, 2004 01:30


All times are GMT -4. The time now is 01:11.