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/)
-   -   Equilibrium thru Interface (https://www.cfd-online.com/Forums/openfoam-solving/109477-equilibrium-thru-interface.html)

tjliang April 23, 2018 08:40

Quote:

Originally Posted by Cyp (Post 392947)
I can explain it to you through a simple example. Consider only the diffusion between two phases (beta and gamma for instance) :

In the beta-phase you have
\nabla \cdot  D_{\beta}\nabla C_{\beta} = 0,

and in the gamma-phase
\nabla \cdot  D_{\gamma} \nabla C_{\gamma} = 0.

Both phases are connected through a flux continuity at the interface
\textbf{n}_{\beta\gamma} \cdot D_{\beta} \nabla C_{\beta} = 
\textbf{n}_{\beta\gamma} \cdot D_{\gamma} \nabla C_{\gamma} \texttt{  at  } \mathcal{A}_{\beta \gamma},

and the thermodynamic equilibrium condition reads:
C_{\beta}=H C_{\gamma} \texttt{  at  } \mathcal{A}_{\beta \gamma}


What you look for is an partial differential equation that govern
C = \alpha C_{\beta} + (1-\alpha) C_{\gamma}
where \alpha is the phase indicator provided from the VOF solution. With such a formulation, C is defined on the whole domain. In the same manner, you can defined a diffusion field as
D = \alpha D_{\beta} + (1-\alpha) D_{\gamma}

Now you express the derivative of C :
\nabla C = \alpha \nabla C_{\beta} + (1-\alpha) \nabla C_{\gamma} + (C_{\beta} - C_{\gamma})\nabla \alpha

multiplying this relation by D and applying the divergence operator, you get :

\nabla \cdot D \nabla C = \alpha \nabla \cdot D_{\beta}\nabla C_{\beta} + (1-\alpha) \nabla \cdot D_{\gamma} \nabla C_{\gamma}
+ (D_{\beta}\nabla C_{\beta}-D_{\gamma} \nabla C_{\gamma})\nabla \alpha + \nabla \cdot D (C_{\beta} - C_{\gamma})\nabla \alpha

Just keep in mind that according to the distribution theory you have : \textbf{n}_{\beta\gamma} = -\nabla \alpha. Consequently, the previous equation reduces to:

\nabla\cdot D \nabla C = \nabla \cdot D (C_{\beta} - C_{\gamma})\nabla \alpha,

This additional term represents the interfacial jump condition. If there is a continuity, you can get rid of it. However, if you have a partitioning relation, you have to consider it.

At the interface, we have C_{\beta}=H C_{\gamma}.

Consequently, C_{\beta} - C_{\gamma}= (1-H)C_{\gamma}

more over, C = \alpha C_{\beta} + (1-\alpha) C_{\gamma} = (\alpha H + (1-\alpha))C_{\gamma}

So C_{\beta} - C_{\gamma}= \frac{(1-H)}{\alpha H + (1-\alpha)} C

So your diffusion equation becomes :
\nabla\cdot D \nabla C = \nabla \cdot D \frac{(1-H)}{\alpha H + (1-\alpha)} C \nabla \alpha,

With such a formulation, you will automaticly have a jump condition at the interface between beta and gamma.

You can also optimised the solution with D = \frac{D_{\beta} D_{\gamma}}{\alpha D_{\gamma} + (1-\alpha)D_{\beta}}

I let you adapt this exemple to the advection-diffusion equation.

Best regards,
Cyp

Thans a lot Cyp, then what does nß mean in your equation? Do you think that I should use interfoam to start for my plasma-liquid interaction? I see a lot of other standard multiphase solvers in Openfoam and I am quite confused as to which one to choose.

Bests,

Peng

Cyp April 23, 2018 08:49

Quote:

Originally Posted by tjliang (Post 689921)
Thans a lot Cyp, then what does nß mean in your equation? Do you think that I should use interfoam to start for my plasma-liquid interaction? I see a lot of other standard multiphase solvers in Openfoam and I am quite confused as to which one to choose.

Bests,

Peng


\mathbf{n}_{\beta \gamma} is the normal vector to the gas/liquid interface. In your problem, I will say it depends. If you have an immiscible interface between your two fluids. Yes, you can go for a Volume of Fluid solver as a starting point.

rsingh7 July 2, 2018 14:29

Dear FOAMer,

I have imported StarCCM+ mesh to openfoam 5.0 and quality of mesh was also good. The CCM mesh is trimmed mesh with polyhedral cells. The flow simulation for interFoam with species transport equation (Haroun formulation)diverges after some iterations. Below is report of the checkMesh. Help for resolving this issue would be appreciated.


Thanks in advance

*******************************
Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
points: 2709670
faces: 7273254
internal faces: 6550582
cells: 2217107
faces per cell: 6.23508
boundary patches: 10
point zones: 0
face zones: 1
cell zones: 1

Overall number of cells of each type:
hexahedra: 1558763
prisms: 17795
wedges: 1051
pyramids: 73
tet wedges: 51
tetrahedra: 184093
polyhedra: 455281
Breakdown of polyhedra by number of faces:
faces number of cells
4 4
5 43
6 76272
7 247451
8 4264
9 70800
10 3318
11 356
12 16481
13 700
14 204
15 35328
16 60

Checking topology...
Boundary definition OK.
Cell to face addressing OK.
Point usage OK.
Upper triangular ordering OK.
Face vertices OK.
Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
Patch Faces Points Surface topology
flow:period1 110302 113851 ok (non-closed singly connected)
flow:sheet1 229147 166554 ok (non-closed singly connected)
flow:sheet2 228457 166118 ok (non-closed singly connected)
flow:outg 9532 9665 ok (non-closed singly connected)
flow:wallt 9576 9998 ok (non-closed singly connected)
flow:period2 110292 113851 ok (non-closed singly connected)
flow:inl 5071 5594 ok (non-closed singly connected)
flow:wallb 10551 11107 ok (non-closed singly connected)
flow:outl 5792 6040 ok (non-closed singly connected)
flow:ing 3952 4069 ok (non-closed singly connected)

Checking geometry...
Overall domain bounding box (-0.0133625 -0.013 -0.0851) (0.0133628 0.013 0.007)
Mesh (non-empty, non-wedge) directions (1 1 1)
Mesh (non-empty) directions (1 1 1)
Boundary openness (4.18881e-14 -2.88815e-15 1.82866e-17) OK.
Max cell openness = 2.78469e-16 OK.
Max aspect ratio = 9.20971 OK.
Minimum face area = 1.10391e-11. Maximum face area = 6.4e-07. Face area magnitudes OK.
Min volume = 5.01959e-16. Max volume = 5.12e-10. Total volume = 3.4427e-05. Cell volumes OK.
Mesh non-orthogonality Max: 57.8894 average: 11.7876
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 3.2775 OK.
Coupled point location match (average 0) OK.

Mesh OK.

End

sadra2003 June 7, 2022 07:55

Quote:

Originally Posted by Cyp (Post 589232)
@Article{Haroun2010,
Title = {Volume of fluid method for interfacial reactive mass transfer: Application to stable liquid film },
Author = {Y. Haroun and D. Legendre and L. Raynal},
Journal = {Chemical Engineering Science },
Year = {2010},
Number = {10},
Pages = {2896 - 2909},
Volume = {65},
Abstract = {A volume of fluid method is developed in order to simulate reactive mass transfer in two-phase flows and is applied to study reactive laminar liquid film. The thermodynamic equilibrium of chemical species at the interface is considered using Henry's law. The chemical species concentration equation is solved using primitive variables and local fluxes are locally directly calculated at the interface. The present treatment of jump discontinuity of chemical concentration is consistent with a volume of fluid approach and the difficulty to calculate accurate local mass flux across interface is overcome. For plane interface, the precision of the numerical simulation is found to be very satisfactory while for curved interface a special procedure has been developed to reduce the development of spurious fluxes at the interface. The algorithm is validated for different cases by comparison with available solutions. The method is then applied to study non-reactive and reactive mass transfer in a falling liquid film. The results show that the liquid side mass transfer is well predicted by the Higbie (1935) theory when the transfer is controlled by the film advection provided that adequate parameters are considered, i.e. the actual velocity at interface and not the average liquid film velocity. For situations controlled by diffusion, the Sherwood number tends to a constant value characteristic of purely diffusive situations. For the reactive mass transfer, first and second order irreversible chemical reactions in the liquid phase are considered. The numerical results are compared respectively, with Danckwerts (1970) and Brian et al. (1961) solutions and good agreement is observed. The proposed Volume of Fluid method is shown to be well adapted to deal with interfacial reactive mass transfer problems. },
DOI = {http://dx.doi.org/10.1016/j.ces.2010.01.012},
File = {Haroun2010.pdf:ARTICLES/Haroun2010.pdf:PDF},
ISSN = {0009-2509},
Keywords = {\{CFD\}},
URL = {http://www.sciencedirect.com/science/article/pii/S0009250910000291}
}

Cheers,


Hello Cyp,

I am trying to simulate a single bubble movement in a solution of water and sugar with interIsoFoam solver, OF2112. I modified the solver and coupled the density, surface tension and viscosity of solution to the concentration of sugar which is different in various parts of the domain. In order to solve the distribution of sugar (a passive scalar) in the geometry, I added a new equation to the solver as below:

fvScalarMatrix CEqn
(
fvm::ddt(C)
+ fvm::div(phi, C)
- fvm::laplacian(dc,C)
==
fvOptions(C)
);


CEqn.relax();
fvOptions.constrain(CEqn);
CEqn.solve();
fvOptions.correct(C);

Now, the problem is, sugar concentration penetrates inside the bubble which is not correct. I would like to know how can I prevent sugar entering the bubble? I would be more than happy if you share your opinion with me.

sadra2003 June 7, 2022 07:57

a question
 
Quote:

Originally Posted by Astrodan (Post 604839)
Finally my solver works now the way it was supposed to be. For anyone who cares I will attach my modified solver as well as two testcases. All modifications were made by made, but based on the publication by Haroun et al (2010), cited above, as well as Nieves-Remacha et al (2015):
OpenFOAM Computational Fluid Dynamic Simulations of Two-Phase Flow and Mass Transfer in an Advanced-Flow Reactor

María José Nieves-Remacha, Lu Yang, and Klavs F. Jensen
Industrial & Engineering Chemistry Research 2015 54 (26), 6649-6659
DOI: 10.1021/acs.iecr.5b00480
The Attachements:

interHarounFoam:
This is the solver. it is a modified version of interFoam, implementing both Equations found in Nieves-Remacha (2015), Supplemental. This means it implements as well the Haroun approach, as an approach by Marshall et al. (2012). It is merely for testing purpose, the diffusion coefficients are fixed to 1e^{-5} m^2 s^{-1} in the createFields.H, and the fields used are named H (for Haroun) and M (for Marshall).

NievesRemacha2015:
This is a sample case for the first example in the supplemental by Nieves-Remacha et al. It contains all relevant data to run interHarounFoam and generate one set of the results.

Haroun2010:
A sample case to reproduce the example shown in Figure 1 a/b of Haroun et al. (2010). This case can be run as it is, too.

A couple of further notes:
  • Both sample cases contain a visual.pvsm, which can be loaded in paraview (either using File > Load State) or starting paraview with the parameter --state=visual.pvsm.
    You will have to fix the path to your case, though.
  • Since diffusion coefficients and Herny coefficient are fixed in the solver, you will need to modify the createFields.H and re-compile the solver every time you want to try other values. Sorry about that. I am working on a library, which does the same thing, only better, which I intend to "publish" here soon.
  • In the fvSchemes make sure to use a Gauss linear scheme (or Gauss cubic, for what it matters) to solve div(phi,C). Most other schemes will fail, somewhere between extremely wrong results to crashing the solver.
  • Nieves-Remacha implement both equations as balances using the cellSurface (surfaceScalarField phiC), calculating first phiC ~ snGrad(alpha) and then div(phiC). Mathematically, the same could be achieved by having a laplacian(c, alpha) (something like that). Here OF allows to use a volScalarField c, which can also be created based on Harouns equation. However, this doesn't work either. I couldn't be bothered with the numerics or maybe even a simpler, mathematical reason for this, but you might care about this if you ever want to implement it on your own. Took me some days..
I hope this helps someone, I worked on this for quite a while.


May the foam be with you,
Timm


Hello Astrodan,

I am trying to simulate a single bubble movement in a solution of water and sugar with interIsoFoam solver, OF2112. I modified the solver and coupled the density, surface tension and viscosity of solution to the concentration of sugar which is different in various parts of the domain. In order to solve the distribution of sugar (a passive scalar) in the geometry, I added a new equation to the solver as below:

fvScalarMatrix CEqn
(
fvm::ddt(C)
+ fvm::div(phi, C)
- fvm::laplacian(dc,C)
==
fvOptions(C)
);


CEqn.relax();
fvOptions.constrain(CEqn);
CEqn.solve();
fvOptions.correct(C);

Now, the problem is, sugar concentration penetrates inside the bubble which is not correct. I would like to know how can I prevent sugar entering the bubble? I would be more than happy if you share your opinion with me.


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