CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   mixing fresh-saltwater (https://www.cfd-online.com/Forums/openfoam-solving/129491-mixing-fresh-saltwater.html)

aronne030389 February 6, 2014 07:16

mixing fresh-saltwater
 
Hi, i'm really new to OpenFoam and i'm looking for a solver that can simulate the mixing between salt water and fresh water. In principle it's just one phase and i have to solve the transport equation for the solute (NaCl) that affects the density,there's any specific solver??. I look to interMIxingFoam putting phase2 fresh and phase3 salt water and setting the diffusion coeff between them. But i don't understand the physic behind this solver : that coeff of diffusion can be treat as molecular diffusion ? which is the transport equation that rule the process? ... and what about twoLiquidMixingFoam....thanks very much

Villo February 6, 2014 07:47

Hi aronne,
i think twoLiquidMixingFoam is perfect for your issue.
Is a solver for mixing between two fluids (single phase) with different diffusion properties.
You will see that the transport equation will use the scalar alpha as ratio between the two different densities.
You can explore the solver here
applications/solvers/multiphase/twoLiquidMixingFoam/
Tommy

aronne030389 February 6, 2014 13:41

Hi Tommy Thank you,
i loked into the solver folder. Am i right saying that i can consider molecular diffusion between saltwater and freshwater as the Dab coefficients to set in the transportPropertiesDict?? then there's also a turbulence diffusion ( alphatab*turbulence->nut() ) that in my work i will not consider since my flow are laminar.

FROM fille
AlphaDiffusionEqn.H

{
fvScalarMatrix alpha1Eqn
(
fvm::ddt(alpha1)
- fvc::ddt(alpha1)
- fvm::laplacian
(
volScalarField("Dab", Dab + alphatab*turbulence->nut()),
alpha1
)
);

alpha1Eqn.solve();

alpha2 = 1.0 - alpha1;
rhoPhi += alpha1Eqn.flux()*(rho1 - rho2);
}

rho = alpha1*rho1 + alpha2*rho2;

Villo February 6, 2014 14:01

This is the ./constant/transportProperties for twoLiquidMixingFoam
https://github.com/OpenFOAM/OpenFOAM...portProperties
You will see Dab [0 2 -1 0 0 0 0], or else [m^2/s]: yes, that's the molecular diffusivity.
About nut: yes, if you're in laminar you can also delete it.

aronne030389 February 11, 2014 10:34

thank you so much , it seem to work. Have a nice job!!

Villo February 11, 2014 10:40

Quote:

Originally Posted by aronne030389 (Post 474496)
thank you so much , it seem to work. Have a nice job!!

cool! I had to work a lot on that solver, if you need any help (principally via LES models) just ask.
have fun!

Bodo1993 January 7, 2020 09:36

1 Attachment(s)
Quote:

Originally Posted by Villo (Post 474499)
cool! I had to work a lot on that solver, if you need any help (principally via LES models) just ask.
have fun!


Dear Villo,

I use twoLiquidMixingFoam solver in OpenFOAM. In my setup, I have a single inlet and two outlets as shown in the attachment. The two fluids are expected to mix and exit through the outlets.
I am wondering what would be the boundary conditions for the alpha phase in this case.
I use zeroGradient or inletOutlet. Initially, it works fine since only single phase exists at the outlet boundary. However, when a mixed phase reaches the outlet boundary, I get some vortices (see attachment).
In the zero directory, I have three files only; p_rgh, U and alpha.phase1.
I would appreciate any assistance.
Thanks.


All times are GMT -4. The time now is 14:35.