Hi Nihal and Prof. Popinet,
I have been working on a similar problem (implementation of Generalized Newtonian Viscosity in Basilisk C). Pierre-Yves Lagrée's sandbox has been helpful for this. I have a few comments and then a doubt:
I extended the method described at http://basilisk.fr/sandbox/M1EMN/Exemples/bingham_simple.c for generalized Newtonian fluids, and it works well. (the code can be accessed at https://github.com/VatsalSy/PlanarCouetteFlow_PowerLaw.
I changed the way D2 is calculated in the above code (and in Pierre-Yves Lagrée's sandbox) to do the calculations at the face centers instead of the cell-centers. The part of the code that changed is:
double muTemp = mu_0;
foreach_face() {
double D11 = (u.x[] - u.x[-1,0]);
double D22 = ((u.y[0,1]-u.y[0,-1])+(u.y[-1,1]-u.y[-1,-1]))/4.0;
double D12 = 0.5*(((u.x[0,1]-u.x[0,-1])+(u.x[-1,1]-u.x[-1,-1]))/4.0 + (u.y[] - u.y[-1,0]));
double D2 = sqrt(sq(D11)+sq(D22)+2.0*sq(D12))/(Delta);
if (D2 > 0.0) {
double temp = tauy/(sqrt(2.0)*D2) + mu_0*exp((n-1.0)*log(D2/sqrt(2.0)));
muTemp = min(temp, mumax);
} else {
if (tauy > 0.0 || n < 1.0){
muTemp = mumax;
} else {
muTemp = (n == 1.0 ? mu_0 : 0.0);
}
}
muv.x[] = fm.x[]*(muTemp);
}
boundary ((scalar *){muv});
The only difference that I found was that using the above code, I was able to predict the plug region accurately, but the difference is not that high.
The code is available at https://github.com/VatsalSy/PlanarCouetteFlow_PowerLawV2
I was also able to reproduce Popinet’s sandbox results from http://basilisk.fr/sandbox/popinet/lid-bingham.c, where he uses the Augmented Lagrangian Method to solve for Bingham fluids. The code is available at:
https://github.com/VatsalSy/LidDrivenFlowVP
So, with these tests, I am reasonably confident that the implementation of regularization is ok. As a final test, I wanted to simulate the test case used in Gerris (http://gerris.dalembert.upmc.fr/gerris/tests/tests/couette.html) in Basilisk. For this, I use the recently added embedded boundary method to have a rotating inner cylinder (http://basilisk.fr/src/embed.h). The code I use is available at https://github.com/VatsalSy/RotatingCouette
The technique works well for Bingham fluids, but I could not reproduce the Gerris (and theoretical) results for power law / Shear-thinning fluids (with n = 0.5).
Can you please suggest me why that would be so? Or, maybe some other (better?) test case for verifying that the method works fine. I have changed the values of mu_0, mumax, refinement level, and time-step but the result attached is the best I could get. I also tried doing the same case with Pierre-Yves Lagrée's method of calculating D2 at the cell-center instead of the face center with no improvement.
I have attached the final results from each of the four simulations that I have mentioned here with this post.
P.S. Another thing which is strange is that if I reduce the value of n from 0.5 to 0.38-0.42, it matches the Gerris (and theoretical) results quite well.
Ph.D. Student | Past: |
I extended the method described at http://basilisk.fr/sandbox/M1EMN/Exemples/bingham_simple.c for generalized Newtonian fluids, and it works well. (the code can be accessed at https://github.com/VatsalSy/PlanarCouetteFlow_PowerLaw.
So, with these tests, I am reasonably confident that the implementation of regularization is ok.
As a final test, I wanted to simulate the test case used in Gerris (http://gerris.dalembert.upmc.fr/gerris/tests/tests/couette.html) in Basilisk. For this, I use the recently added embedded boundary method to have a rotating inner cylinder (http://basilisk.fr/src/embed.h). The code I use is available at https://github.com/VatsalSy/RotatingCouetteThe technique works well for Bingham fluids, but I could not reproduce the Gerris (and theoretical) results for power law / Shear-thinning fluids (with n = 0.5).
…
P.S. Another thing which is strange is that if I reduce the value of n from 0.5 to 0.38-0.42, it matches the Gerris (and theoretical) results quite well.
It would be nice to open your own sandbox on basilisk page and put all these codes there!