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/)
-   -   Implicit solver for gamma volumefraction equation (https://www.cfd-online.com/Forums/openfoam-solving/58552-implicit-solver-gamma-volumefraction-equation.html)

sek June 20, 2007 12:19

Cuurently, the volume-fraction
 
Cuurently, the volume-fraction equation in interFoam, for instance, uses an explicit solver. I was curious whether using an implicit solver would allow me to use larger time-step size. So, I tried to call MULES::implicitSolve01 instead of MULE::explicitSolve1 in gammaEqn.H. It seems to work. One thing I'm not sure about is one of the argument Dpsi of dimensionedScalar type. Looking at the MULE implementation, Dpsi of appears to be a diffusivity introduced as a stabulity measure for gamma equation. I set it to a small value, which seems to work.

Can someone comment on whether I'm doing things right, please?

ngj September 9, 2008 08:42

Hi all I would like to rest
 
Hi all

I would like to restart this discussion. Is there anyone who has successfully implemented an implicit solver for the gamma equation?
I tried the above approach but was not able to get it to work.

Further, what is the argument behind the hard-coded "MULES::explicitSolve01" in the interFoam-solvers.

I am currently using 1.4.1.

Thank you for any help or suggestions.

/ Niels

pbohorquez September 9, 2008 13:12

MULES::implicitSolve works wit
 
MULES::implicitSolve works with success in the solver interPhaseChangeFoam (OF-1.5).

Following src/finiteVolume/fvMatrices/solvers/MULES/MULES.H it reads

MULES:explicitSolve01(psi, phi, phiPsi) ask you for:
- psi: actual value of the variable to be solved
- phi: normal convective flux
- psiPhi: actual explicit flux of the variable to solve. It is also used to return the limited flux of the bounded solution.

Obviously, psi = gamma for interFoam. Then, phi = U·S, where U is the velocity vector and S is the normal to the cell surface times the cell-surface area. Its value comes from the PISO-loop. Finally, psiPhi = gamma [U+(1-gamma)U<sub>r,gamma</sub>]·S = gamma U<sub>gamma</sub>·S, where U<sub>r,gamma</sub> is the relative velocity of the water with respect to the air at the thick free-surface, and U<sub>gamma</sub> is the velocity of the gamma-phase.

Patricio

ngj September 10, 2008 06:53

Hi Patricio Thanks for the
 
Hi Patricio

Thanks for the quick answer. I will download 1.5. and look into it.

Best regards,

Niels

ngj September 12, 2008 10:06

Hi all I have tried to find
 
Hi all

I have tried to find some documentation on the MULES-procedure, but on Web of Science I can only find references to the "animal"-kind of MULES.

Further in Henrik Ruches he describes what looks like the used procedure, but refer to a N_a_b_l_a Ltd technical note.

Thus is is possible that

H.G.Weller, Derivation, modelling and solution of the conditionally averaged two-phase flow equations. Technical Report TR/HGW/02, N_a_b_l_a Ltd, 2002

could be made available? If anyone knows another source of documentation I would be happy to know about it.

Best regards and a good weekend to all,

Niels

eugene September 12, 2008 11:50

MULES was invented by Henry la
 
MULES was invented by Henry last year (or was it 2006?) and nothing has ever been published, so you aren't likely to find any documentation about it.

ngj September 13, 2008 06:20

Hi @Eugene Okay, I am s
 
Hi

@Eugene

Okay, I am sorry to hear that, but there is of course nothing to do about it.

@Other

I have tried to shift to a MULES::implicitSolver in interFoam, but I keep running it problems with my fvSolution file. From the source "MULESImplicit" should be a subDict in the gamma-solution file, thus I have added this to the file:

gamma PBiCG
{
MULESImplicit
{
maxIter 1000;
nLimiterIter 10;
maxUnboundedness 1;
CoCoeff 0.2;
}
preconditioner DILU;
tolerance 1e-06;
relTol 0;
};

thus even though I have added it as a subDict, I keep getting this error message:

keyword MULESImplicit is undefined in dictionary "/home/ngj/OpenFOAM/ngj-1.5/run/tutorials/interFoam/damBreak/system/fvSolution:: gamma"

file: /home/ngj/OpenFOAM/ngj-1.5/run/tutorials/interFoam/damBreak/system/fvSolution::g amma from line 47 to line 54.

From function dictionary::subDict(const word& keyword)
in file db/dictionary/dictionary.C at line 288.

FOAM exiting

Thus if any knows how to set the gamma-part of fvSolution, then please help.

Best regards,

Niels

P.S. For any, do not take the values in the subDict seriously, as I have not looked into the meaning behind those yet.

kjmaki September 13, 2008 08:16

Hi Niels! I am sorry that I
 
Hi Niels!

I am sorry that I can't help you with the MULESImplicit, but I find it strange that the MULESExplicit controls are read from the PISO dict, and the Implicit are from the gamma dict. Do you know why they would do that?

Also, there is some mention on the gamma transport equation that FOAM uses in the thesis by Rusche (2002), sec 4.2.1. You will see that it references private communication with Weller for the details though.

Have a great weekend!

Kevin

pbohorquez September 13, 2008 09:31

Hi Niels I suppose that you
 
Hi Niels

I suppose that you have replaced the files gamma* of interFoam with those from interPhaseChangeFoam, commented the lines related to Sp & Su in gammaEqn.H and call MULES::implicitSolve(oneField(), gamma, phi, phiGamma, zeroField(), zeroField(), 1, 0); (or similar)

Then you must try this option instead of the one you proposed:
gamma
MULESImplicit
{
maxIter 1000;
nLimiterIter 10;
maxUnboundedness 1;
CoCoeff 0.2;
solver PBiCG
{
preconditioner DILU;
tolerance 1e-06;
relTol 0;
};
};

and add to fvSchemes the following line:
div(rhoPhi,U) Gauss limitedLinearV 1; It works.




Patricio

pbohorquez September 13, 2008 09:36

Hi Niels I suppose that you
 
Hi Niels

I suppose that you have replaced the files gamma* of interFoam with those from interPhaseChangeFoam, commented the lines related to Sp & Su in gammaEqn.H and call MULES::implicitSolve(oneField(), gamma, phi, phiGamma, zeroField(), zeroField(), 1, 0); (or similar)

Then you must try this option instead of the one you proposed:
gamma
MULESImplicit
{
maxIter 1000;
nLimiterIter 10;
maxUnboundedness 1;
CoCoeff 0.2;
solver PBiCG
{
preconditioner DILU;
tolerance 1e-06;
relTol 0;
};
};

and add to fvSchemes the following line: div(rhoPhi,U) Gauss limitedLinearV 1; It works. I have sent a message to your email with the files

Patricio

ngj September 13, 2008 12:59

Hi Patricio Yes, I have cha
 
Hi Patricio

Yes, I have changed the gamma* files, and I will get to work a.s.a.p.

Again, thanks for your kind help.

/ Niels

caw September 14, 2008 15:57

Dear Niels, i have been fol
 
Dear Niels,

i have been following up this thread and tried the impicit version of interFoam myself.
Out of curiosity: What do you try to achive by using an implicit formulation for the gamma equation?
And do you succeed?

Thing that spring to my mind:
- stability -> higher time steps
- steady state solutions

Could you comment on that please?

Best regards
Christian

ngj September 16, 2008 09:30

Hi Christian Sorry for the
 
Hi Christian

Sorry for the wait, I am in the middle of a not-coorporating reinstall, so I will make it short.

The actual goal was to consider if the implicit solver did give raise to a different exchange of energy between water and air. I, and I know others have the same problem, get large velocities in the air phase, significantly larger than the wave propagation speed.

Due to reinstallation, I have not reached a conclusion, thus this is the closests I can get.

Generally I have not experienced instability problems with waves, except if they break and I use a laminar solver, then the energy cannot be dissipated at a significantly large enough rate.

Best regards,

Niels

santhanuj April 6, 2009 11:42

can anyone tell me how the relative velocity is calculated???

isabel June 29, 2009 14:27

I need to solve the gamma equation in interFoam. But I want to add a source as that:

d(gamma)/dt + div(U*gamma) + div(phigamma) = source

How can I do this? Perhaps with this line: ?

MULES:: implicitSolve(gamma,phi,phiGamma,source)

ngj June 30, 2009 06:39

Hi Isabel

Please look into the source in the folder:

~/OpenFOAM/src/finiteVolume/fvMatrix/solvers/MULES

and you will be able to find out about the syntax.

Best regards,

Niels

isabel June 30, 2009 08:54

Thank you very much, ngj
The key is in MULESTemplates.C in these lines:


fvScalarMatrix psiConvectionDiffusion
(
fvm::ddt(rho, psi)
+ fv::gaussConvectionScheme<scalar>(mesh, phi, UDs).fvmDiv(phi, psi)
- fvm::Sp(Sp, psi)
- Su
);


I think that the equation that it is solving is:

d(rho*psi)/dt + div(phi*psi) - Sp*psi - Su = 0

Am I right?

sandy July 7, 2009 05:29

Quote:

Originally Posted by isabel (Post 220950)
Thank you very much, ngj
The key is in MULESTemplates.C in these lines:


fvScalarMatrix psiConvectionDiffusion
(
fvm::ddt(rho, psi)
+ fv::gaussConvectionScheme<scalar>(mesh, phi, UDs).fvmDiv(phi, psi)
- fvm::Sp(Sp, psi)
- Su
);


I think that the equation that it is solving is:

d(rho*psi)/dt + div(phi*psi) - Sp*psi - Su = 0

Am I right?

==================================

Hi, it seems that you lost the compressible term: div(gamma*(1-gamma)*phi). I guess the gamma equation should be as follows:

d(rho*gamma)/dt + div(phi*gamma) + div(gamma*(1-gamma)*phi) - Sp*gamma - Su = 0

In MULESTemplates.C,
phiPsi = phiGamma = phi*gamma + gamma*(1-gamma)*phi

is it right? If that, in gammaEqu.H, why Su = divU*gamma + vDotcAlphal ? It look like that the term divU*gamma was repeatedly solved ?? :confused:

I knew, to the gamma transport equation,
Source term = vDotvAlphal * gamma + (1 - gamma) * vDotcAlphal = (vDotvAlphal - vDotcAlphal) * gamma + vDotcAlphal.
So, Sp = (vDotvAlphal - vDotcAlphal) * gamma , and it will be solved implicitly.
Su = vDotcAlphal, and it is an explicit term in this equation.

but again, why Su also includes the term divU*gamma in gammaEqu.H ? If the MULES::implicitSolver was chose, this term should be deleted, right? :confused:

isabel July 7, 2009 14:28

Thank you very much, sandy.


I have been studying the interPhaseChange solver carefully.
As you say, in gammaEqn.H we define the variable phigamma:


phigamma = phi*gamma + gamma*(1-gamma)*phir
Sp = vDotvAlphal – vDotcAlphal
Su = div(U)*gamma + vDotcAlphal


And then, when we execute MULES::explicitSolve(oneField(),gamma,phi,phiGamma ,Sp,Su,1,0);
we associate:

rho → oneField ()
psi → gamma
phi → phi
phiPsi → phigamma
Sp → Sp
Su → Su
psiMax → 1
psiMin → 0


and then, the key is in this lines of MULESTemplates.C:


fvScalarMatrix psiConvectionDiffusion
(
fvm::ddt(rho, psi)
+ fv::gaussConvectionScheme<scalar>(mesh, phi, UDs).fvmDiv(phi, psi)
- fvm::Sp(Sp, psi)
- Su
);

......


solve
(
psiConvectionDiffusion + fvc::div(lambda*phiCorr),
MULEScontrols.lookup("solver")
);


That I think that the equation is


d(1*psi)/dt + div(phigamma) + Sp*gamma - Su = 0



I don't know what means this line:
fv::gaussConvectionScheme<scalar>(mesh, phi, UDs).fvmDiv(phi, psi)

but I think you are right, div(U) is repeated. I will ask for my advisors and I will confirmate.

Do you know what these lines means?


slicedSurfaceScalarField lambda
(
IOobject
(
"lambda",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimless,
allLambda,
false // Use slices for the couples
);

sandy July 7, 2009 20:20

but I think you are right, div(U) is repeated. I will ask for my advisors and I will confirmate.

Do you know what these lines means?


slicedSurfaceScalarField lambda
(
IOobject
(
"lambda",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimless,
allLambda,
false // Use slices for the couples
);[/QUOTE]
=============================

Hi isabel, you have a great advisor, right? You are lucky. I think, in above code, lambda = allLambda, if you want know more informations about it, you can change the code as follows:

-------------------------------------
slicedSurfaceScalarField lambda
(
IOobject
(
"lambda",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE,
false
),
mesh,
dimless,
allLambda,
false // Use slices for the couples
);
-----------------------------------

Then, you can get an detailed output file in every iterative step about the "lambda" field.

By the way, this kind of method can also help us to easily debug the codes in OF.

But, now I still don't know what means this line:
fv::gaussConvectionScheme<scalar>(mesh, phi, UDs).fvmDiv(phi, psi), and how to deal with the divU*gamma of Su ..... if you know them, please let me know too. Thanks.

isabel July 8, 2009 04:35

I only have advisors this week. I am at a OpenFOAM course, which finishes on Friday.

fv::gaussConvectionScheme<scalar>(mesh, phi, UDs).fvmDiv(phi, psi),

This line is to calculate div(phi, psi). The begining is only to specify to the program how to calculate it.

And the div(U) is repeated.

sandy July 8, 2009 05:36

Wow, it is great. Thank you very much.

By the way, what a OF course are you studying? Do you have some documents or websites to share?

Sandy
sandy.lee37@gmail.com

chiven November 5, 2009 04:31

Hi, everybody, I am trying to use the interPhaseChangeFoam in OpenFOAM-1.6, and just meet the same problem how to set MULES::implicit in the fvSolution file. Any suggestions are appreciated.

Best regards,
Chiven

sandy November 5, 2009 19:48

Hi Chiven, is there the tutorial about InterPhaseChangeFoam in OF-1.6? I use the OF-1.5.

-------------------------------------
gamma MULESImplicit
{
maxIter 1000;
nLimiterIter 10;
maxUnboundedness 1;
CoCoeff 0.2;
solver PBiCG
{
preconditioner DILU;
tolerance 1e-10;
relTol 0;
};
};



chiven November 5, 2009 20:23

Hi, Sandy, thanks for your reply.

I have justed used the similar setting like yours, but failed. At this time, I have NOT run the interPhaseChangeFoam successfully in OpenFOAM-1.6.

Code:

    alpha1
    {
        MULESImplicit
        {
        maxIter 1000;
        nLimiterIter 10;
        maxUnboundedness 1;
        CoCoeff 0.2;
            solver PBiCG
            {
            preconditioner DILU;
            tolerance 1e-10;
            relTol 0;
            }
        }
    }

Best regards,
Chiven



Quote:

Originally Posted by sandy (Post 235283)
Hi Chiven, is there the tutorial about InterPhaseChangeFoam in OF-1.6? I use the OF-1.5.

-------------------------------------
gamma MULESImplicit
{
maxIter 1000;
nLimiterIter 10;
maxUnboundedness 1;
CoCoeff 0.2;
solver PBiCG
{
preconditioner DILU;
tolerance 1e-10;
relTol 0;
};
};


kumar March 29, 2010 14:20

Hello
I am planning to modify the interfoam solver of OF-1.6.x with the implcitMULES and use an LES simulation. I am studying the breakup of 2D liquid sheets. I have already run some simulations in which i see that the solution is very much dependent in the CFL number

I want to know th experience of other interFOAM users who have used an implicitMULES. Do you really find a difference in the solution of two explicitMULES and implicitMULES. And if yes what was the improvement. Is it advicable to give the implicitMULES a try. Will it allow me to use higher CFL numbers.

bye
with regards
K.Suresh kumar

kumar April 8, 2010 06:08

Hello interFoam and interphasechange users,

I implemented the implicit::MULES in interFoam in OF-1.6.x . Thanks to Niels and pbohorquez.and ran it with the LES model on some preliminary test cases. I can already see that the results are much better than the explicit::MULES case.
So i have decided to further look into the implicit::MULES solver. I already read the posts in this discussion. That gave me a good idea about the form of the equation that is being solved in the two cases.

But I would like to know more about the discretization of the transport equation when i am using an implicit::MULES, because i really dont get anything about the parameters that i specify in the fvSolution

gamma PBiCG
{
MULESImplicit
{
maxIter 1000;
nLimiterIter 10;
maxUnboundedness 1;
CoCoeff 0.2;
}
preconditioner DILU;
tolerance 1e-06;
relTol 0;
};

so it would be very useful to me if anybody gives some explanation about the discretization in the case of MULES implicit.

with regards
K.Suresh kumar

nimasam July 14, 2010 13:25

hi friend
the correct form of alpha fvSolution is like below :
alpha1 MULESImplicit
{
maxIter 1000;
nLimiterIter 10;
maxUnboundedness 1;
CoCoeff 0.2;
solver PBiCG;
preconditioner DILU;
tolerance 1e-06;
relTol 0;
};

kaifu June 17, 2011 17:18

Quote:

Originally Posted by sandy (Post 221717)
==================================

Hi, it seems that you lost the compressible term: div(gamma*(1-gamma)*phi). I guess the gamma equation should be as follows:

d(rho*gamma)/dt + div(phi*gamma) + div(gamma*(1-gamma)*phi) - Sp*gamma - Su = 0

Hi Sandy,

In order to strictly restrict alpha in [0,0.52], I am now considering to use MULES in case of bubbly flow. I have a question here since in Weller's scheme, there is a compression term (eqn 4.13, Rusche). And it is said "The arti ficial term is only active in the thin interface region because of the multiplication term gamma(1-gamma)". It is true in case of liquid-vapor with clear interface which only exists somewhere. However in bubbly flow, the interface could be everywhere. I dont know if it is appropriate to use this scheme in my case. Thanks.

// Kai

sandy June 27, 2011 21:11

You can try them, respectively. I guess, there are not differences in results but in the performance of convergence ...

pablodecastillo July 14, 2011 05:08

Hello Suresh,

What are the steps to update interfoam from mules::explicit to mules::implicit??

Advanced thanks,

Pablo

akidess July 14, 2011 06:01

Pablo, simply replace the call to MULES::explicitSolve in alphaEqn.H to MULES::implicitSolve and recompile. You will need some extra entries in the fvSolution file as shown in a post earlier in this thread, and that's it.

pablodecastillo July 14, 2011 13:47

Thanks Anton,

It is working, i copied from interphase tutorial;

alpha1
{
maxUnboundedness 1e-5;
CoCoeff 2;
maxIter 5;
nLimiterIter 2;

solver PBiCG;
preconditioner DILU;
tolerance 1e-12;
relTol 0.1;
};

but what mean cocoeff,maxiter and nlimiter??

ehsan March 27, 2012 23:11

report
 
Hello all

Could any one share this file with me:
OpenCFD, OpenCFD Technical report no. TR/HGW/02 (unpublished); 2005

Regards

nygbook June 25, 2012 22:41

Quote:

Originally Posted by sandy (Post 221717)
==================================

Hi, it seems that you lost the compressible term: div(gamma*(1-gamma)*phi). I guess the gamma equation should be as follows:

d(rho*gamma)/dt + div(phi*gamma) + div(gamma*(1-gamma)*phi) - Sp*gamma - Su = 0

In MULESTemplates.C,
phiPsi = phiGamma = phi*gamma + gamma*(1-gamma)*phi

is it right? If that, in gammaEqu.H, why Su = divU*gamma + vDotcAlphal ? It look like that the term divU*gamma was repeatedly solved ?? :confused:

I knew, to the gamma transport equation,
Source term = vDotvAlphal * gamma + (1 - gamma) * vDotcAlphal = (vDotvAlphal - vDotcAlphal) * gamma + vDotcAlphal.
So, Sp = (vDotvAlphal - vDotcAlphal) * gamma , and it will be solved implicitly.
Su = vDotcAlphal, and it is an explicit term in this equation.

but again, why Su also includes the term divU*gamma in gammaEqu.H ? If the MULES::implicitSolver was chose, this term should be deleted, right? :confused:

hello, Sandy. I have some question about the source item in interPhaseChangeFoam. In this Solver, vDotcAlphal = vDotvAlphal * gamma + (1 - gamma) * vDotcAlphal = (m+ + m-)*(1/rho1 - alpha(1/rho1 -1/rho2)). I doesn't understand why it is (1/rho1 - alpha(1/rho1 - 1/rho2). I think it should be source = (m+ + m-)/rho1.
So, can you give me some suggestion?

sandy June 25, 2012 23:16

Hi, why you not read some papers by Dr. Lu Naixian and deduce those equations?

zarox March 27, 2014 13:02

Hi,

I think, it is not as trivial as you suggest in a not very friendly way. In addition, it is link to a query often ask in this forum and As far as I have searched I did not find an answer.

If someone have any interrest on this, in can give some suggestion.

Bye

gucong November 7, 2014 18:20

Quote:

Originally Posted by nygbook (Post 368294)
hello, Sandy. I have some question about the source item in interPhaseChangeFoam. In this Solver, vDotcAlphal = vDotvAlphal * gamma + (1 - gamma) * vDotcAlphal = (m+ + m-)*(1/rho1 - alpha(1/rho1 -1/rho2)). I doesn't understand why it is (1/rho1 - alpha(1/rho1 - 1/rho2). I think it should be source = (m+ + m-)/rho1.
So, can you give me some suggestion?

Hi,

I'm also confused. Have you been successful in finding why the volumetric source is formulated with this coefficient? It is the same as rho_mixture / (rho_1 * rho_2).

gaza July 11, 2015 05:59

Quote:

hello, Sandy. I have some question about the source item in interPhaseChangeFoam. In this Solver, vDotcAlphal = vDotvAlphal * gamma + (1 - gamma) * vDotcAlphal = (m+ + m-)*(1/rho1 - alpha(1/rho1 -1/rho2)). I doesn't understand why it is (1/rho1 - alpha(1/rho1 - 1/rho2). I think it should be source = (m+ + m-)/rho1.
Hi nygbook
You can find an answer in Jibran Heider master thesis in chapter 2.1

http://www.cimne.com/cvdata/cntr2/sp...branHaider.pdf


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