CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   interFoam behavior in micro-dimensions (https://www.cfd-online.com/Forums/openfoam/72038-interfoam-behavior-micro-dimensions.html)

moh1367 March 6, 2010 00:34

Hi !

In my opinion, yes!
I check my velocity field and it seemed OK! The courant was about 0.4-0.8 at first and now it reduced so much. Do you resolve your case with very small DeltaT?

Sincerely

openfoam1 March 7, 2010 00:17

Quote:

Originally Posted by moh1367 (Post 248794)
Hi !

In my opinion, yes!
I check my velocity field and it seemed OK! The courant was about 0.4-0.8 at first and now it reduced so much. Do you resolve your case with very small DeltaT?

Sincerely

Hi
when i reduced the courant number from 0.25 to 0.005 ,, the currents completely disappeared ,, and the problem almost solved ,,

there is another question

i want to enter a boundary condition on the lower wall for alpha1 ,, i want to use alphaContactAngle boundary condition ,, i must enter the following:

1) static contact angle (theta0)
2) the leading and trailing edge dynamic contact angles (thetaA),(thetaR)
3) velocity scaling function for dynamic contact angle (uTheta)

is this important to enter (2) and (3) on my simulation, how can i find those values for water and a given solid

thanks very much ..

moh1367 March 7, 2010 00:45

Hi openFoam!
I become very glad about your problem is solved now. you can see about the dynamic contact angle in one of the topic in the forum with this title"Dynamic contact angle". unfortunately I haven the link.
Sincerely

phsieh2005 March 7, 2010 06:46

Hi,

I am glad to hear that this problem was resolved by reducing delta t. But, I am surprised. What is your channel diameter? What is your surface tension coefficient?

Based on what I read about spurious currents, it can be reduced by some methods, but, they usually work only on very good hex quality meshes.

In my case, I usually have to run the case up to 1 sec - 2 sec. Such a small delta t (< 1e-8) is not practical to me because it will take weeks to complete, even on a cluster with 32 CPUs.

Also, I usually run my case with CFL <= 0.3.

Pei

kumar March 13, 2010 08:36

Hello everybody,
I would like to share my experience on the CFL number limit of interFOAM solvers. I have been using lesInterFOAM to study the breakup of liquid shees in 2D. My nozzle thickness is 50 micrometers. And I have run simulations with a range of CFL numbers on the same geometry and same b.cs. My range of CFL numbers span from 0.2 to 0.005. And I also performed a linear stability analysis in Mathematica for verifying my results. Then I found out that the case with the largest CFL number is 0.2 overpredicted the dominant wavelength when compared to the linear stability analyis. Whereas the case with the lowest CFL number 0.005 predicted the dominant wavelength accurately wwhen compared to the linear stability analysis.

I got into this investigation after looking at the literature "Volume of Fluid methods for immiscible-fluid and free surface flows" Chemical Engineering Journal 141 (2008) 204-221. In this paper it has been specified that the inter-gamma schemes require very small time steps CFL < 0.01 for keeping a sharp interface. But there is no proof given for this condition.
But i think itbecomes infeasible to run simulations on such small time steps.

My question is is it possible to use higher CFL numbers by increasing the nGammaSubcycles. Any experiences on this matter will be appreciated. I am also studying the influence of nGammaSubcycles on the solution.

bye
with regards
K.Suresh kumar

sundaero March 16, 2010 05:35

Probably this tread
http://www.cfd-online.com/Forums/ope...-currents.html
might help those who experiencing high parasitic currents at microscale and as a result a very low time step.

In my case it was a solution.

kumar March 29, 2010 12:52

Hello everybody,
I studied the effect of ngammaSubcycles on the solution. I varied the ngamma Subcycles from 4, 10 ,16,20 while keeping all other parameters constant. The CFL no. was 0.2 and 0.5. There is no difference between these simulations. But i have read in the manual that higher CFL numbers can be used by increaasing this parameter andnot losing the accuracy. I thik this claim is not true.

Then I also modified the pEqn.H and the UEqn.H as specifed in the previous post by SundAERO, I saw that the modification of the surface tension term makes the solution a bit better, but in my case i do not see much improvement. I am still waiting for my simulation to finish and i already see that the simulation without this modification and with the modification are not so different. So i doubt that this modification really does not work for all cases. It always depends on the application that one is studying.

My next question is has anybody tried to use an implicitMULES solver with interFOAM for microdimensions problems. I am planning to compile the implicit MULES with interFOAM and change the fvSchemes files. I just wanted to know if somebody has already tried the implicitMULES solver and seen any improvement in their solution, any comments on comparison between the implicitMULES and explicitMULES solutions for interFOAM are welcome.

Anyhow i will update the findings once i run a implicit case.

bye
with regards
K.Suresh kumar

phsieh2005 March 29, 2010 16:02

Hi, kumar,

I ran 2 completely different cases. Both with and without the modifications.

In one case, the modification help, while in the other case, the modification did not help.

So, whether this modification helps or not is case dependent.

Someone told me that this modification was tested few years ago and the conclusion was the following:

it introduces a serious bias in the force
balance of the surface-tension and the results for capillary-rise etc. were
significantly less accurate.

Pei

kumar April 1, 2010 04:15

Hello interFOAM guys

I am happy to inform that after trying every option in the box, i finally found some sucess with the CFL number issue atleast for my case.

I made an implicit solver for solving the alpha equation by calling the MULES::implicitSolve and had to do some more changes to make the solver work.

But the good news is that i already have some initial results from the implicit solver interFoam which i am running for a CFL no. of 0.25 and i see that they match with the case that i ran with the CFL-0.005. I am using the Euler scheem for time integration, in the implciit case which is first order. And the simulation itself is much faster.

So first of all i would thank the guys for making such a code , where i can change the solver as i want.

I would suggest the people who have the problem with the CFL number, where you need small CFL numbers to obtain a reasonably accurate result, you should give a try by implementing the MULES::implicit in interFoam and try it.

But it may work for your case or not. but it is worth giving a try.

bye
K.Suresh kumar

phsieh2005 April 1, 2010 16:15

Hi, kumar,

I am excited to hear your good news. I am wondering if you will be willing to share your revised interFoam solver so that I can test it on my case. Or, if you can post the changes you made.

Pei

kumar April 2, 2010 09:32

Hello Pei,
I already got my simulaiton finsished , and i see that the results are much better, but i still have to validate it by extracting the dominant wave information because i am studying breakup of liquid sheets. But i can tell you that they are closer to the case that i ran with a CFL -0.005 with an MULES::explicitsolve. But this does not mean that they are correct unless i compare it with experiments, which i am trying to do.

Anyhow regarding the changes for the solver, here is what i did,

1) cp -riuv --parents --backup applications/solvers/multiphase/interFoam $WM_PROJECT_USER_DIR

2)then i go to the $WM_PROJECT_USER_DIR and change the name to implicit_interFOAM

3)mv interFoam.C implicit_interFoam.C
4)i delete the alphaEqn.H and alphaEqnSubcycle.H
5) I copy the files alphaEqn.H and alphaEqnSubcycle.H from interPhaseChangeFoam to the current directory.

6) Then i modify the alphaEqn.H file. The modofoed file is shown below

{
word alphaScheme("div(phi,alpha1)");
word alpharScheme("div(phirb,alpha1)");

surfaceScalarField phir("phir", phic*interface.nHatf());

for (int gCorr=0; gCorr<nAlphaCorr; gCorr++)
{
surfaceScalarField phiAlpha =
fvc::flux
(
phi,
alpha1,
alphaScheme
)
+ fvc::flux
(
-fvc::flux(-phir, scalar(1) - alpha1, alpharScheme),
alpha1,
alpharScheme
);

// Pair<tmp<volScalarField> > vDotAlphal =
// twoPhaseProperties->vDotAlphal();
// const volScalarField& vDotcAlphal = vDotAlphal[0]();
// const volScalarField& vDotvAlphal = vDotAlphal[1]();

// volScalarField Sp
// (
// IOobject
// (
// "Sp",
// runTime.timeName(),
// mesh
// ),
// vDotvAlphal - vDotcAlphal
// );

// volScalarField Su
// (
// IOobject
// (
// "Su",
// runTime.timeName(),
// mesh
// ),
// Divergence term is handled explicitly to be
// consistent with the explicit transport solution
// divU*alpha1
// + vDotcAlphal
// );

//MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
//MULES::explicitSolve(oneField(), alpha1, phi, phiAlpha, Sp, Su, 1, 0);
MULES::implicitSolve(oneField(), alpha1, phi, phiAlpha, zeroField(), zeroField(), 1, 0);

rhoPhi +=
(runTime.deltaT()/totalDeltaT)
*(phiAlpha*(rho1 - rho2) + phi*rho2);
}

Info<< "Liquid phase volume fraction = "
<< alpha1.weightedAverage(mesh.V()).value()
<< " Min(alpha1) = " << min(alpha1).value()
<< " Max(alpha1) = " << max(alpha1).value()
<< endl;
}
And then i compile by changing the Make/files.

But to tun the case sucessfully i had to add the following lines to my fvSolution file
{
alpha1
{
maxUnboundedness 1e-5;
CoCoeff 2;
maxIter 5;
nLimiterIter 2;

solver PBiCG;
preconditioner DILU;
tolerance 1e-12;
relTol 0.1;
};
which i took from the cavitating bullet tutorial. I still have to look in to the tolerance and relTol.

I also changed the ddt schemes in the fvSchemes by setting default Euler


bye
with regards
K.Suresh kumar

phsieh2005 April 2, 2010 09:47

Thanks kumar!

I will give it a try to see if this helps with my two different cases.

Pei

Andrea_85 May 18, 2011 08:01

Hi Kumar,
Have you got any news?. I'm trying to simulate a two fluid system in a microchannel (dimension of the order of micron). Using MULES::explicit i got delta t =1e-7 s and the simulation takes a lot of time. In my opinion, the problem is that at the interface the parasite velocity are too big (up to 0.5 m/s!! when the inlet velocity is 1e-4 m/s) and so the time step remains small (dt=Co*dx/U).
I tried to implement the MULES::implicit, following your suggestions. The time step is still of the order of 1e-7 s and the simulation is very slow. I'm using OF 1.7.1.
Any idea why i can not increase the time step as in your case?

Thanks

andrea

kumar May 18, 2011 08:21

Hi Andrea,
I would first like to ask you, what method are you using for the time discretization, are you using Crank-Nicholson or Euler implicit.

My experience with using MULES::implicit was not satisfactory, so i did not use it for my further study.

Also do you use adjustimestep for your simulation.


regards
K.Suresh kumar

Andrea_85 May 18, 2011 08:39

Hi Kumar, thanks for the answer.
I'm using Euler scheme for ddt and yes, i'm also using adjustable time step.
I have not tried using a fix time step and force the solver to go faster, but i guess it would crash!

andrea

Andrea_85 May 18, 2011 10:24

Do you have any idea to speed up my simulation? How did you solve your problem with the CFL number?

I tried to run exactly the same case as before but now with the dimension of millimiters instead of micron. Everythink is ok, the simulation time is good using Co=0.3.

Any help is appreciated

andrea

navidmt August 27, 2022 18:11

Quote:

Originally Posted by Andrea_85 (Post 308155)
Do you have any idea to speed up my simulation? How did you solve your problem with the CFL number?

I tried to run exactly the same case as before but now with the dimension of millimiters instead of micron. Everythink is ok, the simulation time is good using Co=0.3.

Any help is appreciated

andrea


Hi Andrea, I was wondering If you found any solution to increase the speed of the simulation. I am facing the same issue.

Santhosh91 August 8, 2023 19:41

Hello All,


It is a very interesting thread (even thought old). I am also doing simulations using interFoam for rally low capillary numbers (10^(-5) - 10^(-4)).


The issue , is for me to respect the Brackbill condition (or Galusinski and Vigneaux criterion to take into account the viscosity) with my current meshing (1-2 micrometer/cell), I need to have a courant number of 0.005 at the very least.



However, this lead to excessive waiting time to get enough time steps. Did anyone find a solution to get accurate solutions (avoiding spurious currents) for low capillary numbers problems in interFoam without blowing up the computational time ?


Thanks for any hints or suggestions!




Sincerely,
Santhosh


All times are GMT -4. The time now is 21:29.