alpha1 wrong behaviour with LTSInterFoam [solved]
4 Attachment(s)
Hi Foamers,
I' m setting up (open FOAM v 2.3.0) a case for wave generation and drag calculation using LTSInterFoam. I conduct some basics verification and validation of my set up with a hull, for wich I had the drag values ; and I was able to get a 5% max difference with those value, with a visually coherent wave pattern. Now I'm trying to apply my set-up wih a new hull - wich had quite the same bow as the mini 6.50 747 magnum. The case brake up as the alpha.water get a very wrong behaviour under the hull : outside the boundary layers, alpha seems quite correct but inside the boundary layer it goes to zero near the hull. I've attached some picture with a "cylinder-hull" illustrating this, wich i plotted the interface, colored by z ; and the value of alpha.water on the "cylinder-hull". blue color is full water and red is full air. 1 is the initial situation. Attachment 32069 2, 3 and 4 are ploted from the iteration 1600, we can see that under the "cylinder-hull" there is a water-air mix, when it should be full water. Attachment 32071 Attachment 32070 the 4 picture show that the matter only occur on the boundary layer - when i put more boundary layers, only the first 4-5 boundary layer on the wall get those wrong alpha.water values. Attachment 32072. I also have upload my test case set up here. vSolution : Code:
solvers Code:
ddtSchemes thank you in advance for your help, Quentin Coispeau ps : in my cylinder-test case, the mesh in not high enough in z+ to get the full wave at the bow, but i had the very same alpha problem with my "magnum-like" hull, for wich it was not the case. |
I found out that :
calpha can't be set to 0 : the compression speed used to compressed the interface is calculate as |U_c| = min( calpha * |U|, max |U| ). so if calpha is set to 0, you remove the convective compression flux and alpha equation becomes too diffusive. calpha should be equal to 1 or greater. I also had to had a alpha corrector and set the alpha div scheme to vanLeer again. And reduce maxCo and maxAlphaCo |
hi Quentin,
did it solve all your pb? i just run the beginning of you case. i call this phenomena 'air under hull'. i got this behevior on a catamaran quiet flat hull. i could solve it in Finemarine with a threshold in pressure. i plan to make the same in OF, not done yet... http://www.cfd-online.com/Forums/ope...-pressure.html Laurent |
2 Attachment(s)
Hi Laurent,
Try to run the same case with these dictionnaries instead of the previous ones : fvSolution Code:
solvers Code:
ddtSchemes Attachment 32105 Attachment 32106 But an other matter "the wiggle wave" appears as related in this thread. But as we need the boundary layer to resolve the boundary layer, we can't get a better aspect ratio or am I wrong ?) If you look in fvSolution, i change maxC0 and maxAlphaCo from 5 to 0.2499, so I need 20 times more timeStep, which is quite longer ; i tried to add more alpha subcycles, but the interface becomes quite crazy after not so much timeStep. you're idea of pressure threshold seems quite interesting to me, and should probably be implemented as a new boundary condition. I may give a try in it soon if I can't get satisfactory results without. But i fear it is a bit "cheating" with numerical behaviour, which may false the results - at least it needs validation. I set icalpha to 0.25 because I've seen this value somewhere (don't remember where) but I don't know what's its use and haven't look through the code for it yet. |
1 Attachment(s)
Here an illustration of you're pressure treshold idea : the pressure and the interface on the cylinder with the blue/green jump at p = 250 Pa
Attachment 32107 so it seems possible to implement your pressure condition on alpha quite easely. |
hi,
so, let's say, if p superior at 250 then put alpha=1 but i'am a very beginner in C++... is anyone have a idea of how to do that??? 1- add a variable to declare in transportProperties P0=250 2-add a line in /home/laurent/OpenFOAM/OpenFOAM-2.3.0/applications/solvers/multiphase/interFoam/alphaEqn.H like if (p > P0) { alpha.water=1 } 3- compile could it be SO simple.... i'm dreaming.... any advice will be very welcome! thank to all Laurent |
I think it would be much better to implement a new boundary condition which would be something like
Code:
if (p < P0) |
Dear Quentin,
The behavior you are seeing is called "numerical ventilation". The forcing of the mass fraction alpha to be 1 when the pressure is greater than a certain value like can be done in FINE/Marine is something that should be used with caution. With low speed vessels where real ventilation is unlikely, this can be a way to improve your answer. For high speed craft you should confirm ventilation is numerical instead of real ventilation before applying such a correction. Also be careful about the value of pressure you pick being greater than the stagnation pressure of the air or you will create water in places you don't want it. I should point out that you can correct the friction forces in post treatment by correcting the rho used. This is only appropriate in the case that wall functions were used. Both have their downsides. The best is to avoid the issue by refining the mesh near the where the problem starts and minimizing sources of diffusion (schemes, courant number, etc). Easier said than done since they tend to increase the cost. |
Hi Dave,
thank you very much for your answer. knowing the name of the issue will help me find documentation about it. I had already tried to have less diffusive numerical scheme but it wasn't enough. I'll follow your advice about refining the mesh where the problem appears. I agree with you saying that the pressure threshold trick is more a bandage than a solution. Quote:
EDIT : at the bow, the prismatic boundar layers are oriented ~ 30-40° of the flow, which don't help with the diffusivity. Refining the mesh seems to limit the problem but can't avoid this angle difference between flow and layers... by the way is it correct that the central differencing scheme, i.e, Gauss linear in OF, is the less diffusive scheme (in fact with no numerical diffusion) ? |
hi Quentin,
did you manager to change the OF's code to do the trick, with the pressure? i also did a lots of tryings on better refinement on flat multihull but this trick was working perfectly well, once you know the pressure threshold (mostly depending of the speed ...) could you please help me to make the trick on OF? thanks LL |
Hi Laurent,
yes I manage to do the trick, using the inletOutlet boundary condition as a start. I'll give you my code but i'm not very sure of what I've done and it's definitively not very clean, but it seems to work ; so be careful. It didn't wok in my case because I have both hyper ventilation of air under the hull and water at the bow ; so i'm working again with Dave's advices. You have to recompile the inletOutlet chaging all "inletOutlet" for "alphaHull", and modifying the content of 1) alphaHullfvPatchField.C Code:
/*---------------------------------------------------------------------------*\ 2)alphaHullFvPatchField.H Code:
/*---------------------------------------------------------------------------*\ Code:
hull |
Adding source term to avoid numerical ventilation
Hi foamers, Dave,
With the knowledge of the name of the problem, i found his very intesting publication about resistance calculation for AC33 hulls. In paragraph 4.4 they are speaking about numerical ventilation, explaining how you can correct your skin resistance calculation with rho, but also telling that you could solve the problem adding a source term in the transport equations of ad \alpha_{air} wich would be something like with being an arbitrary distance from the wall and an arbitrary number of iterations:
with ; I think I could rewrite the source terme as : if && , then , else if && , then , else . but i'm no quite sure of this as if i write the transport equation with a source term for : this give me if i transform into the transport equation for : so a gradient of U appears. What do you think about it ? EDIT : it's not a gradient, it's a divergence ... |
Dear Quentin,
Yes, this paper was what I had in mind :) though again it is only good if you have wall functions. Regarding source terms, I would suggest looking at the cavitatingFoam and/or interPhaseChangeFoam to see how they have handled sources in the alpha equation. |
Quote:
Quentin, Thanks for the info. With little knowledge of OpenFOAM and the discretization of these equations, Implementing source terms is quite the challenge. I have a few questions. Using these conditions: " 1) the source I finally implemented is : if && if && else " I see this code: Code:
//** Evaluating Source Terms Could you explain for both conditions above (alpha <.5 and alpha > .5) why Sp is defined in both conditions and Su only defined in the latter? Thank you so much for your help, James |
Hi James,
I havn't work on this for a few month so I don't remember exactly but : Su is the part of the source term not linked to [MATH]\alpha[MATH\] and Sp is the one linked to. It allows you to implement the source term explicitely or implicitely (Su => explicit ; Sp => implicit). there are some conditions regarding the stability of the solution whether the implicit part is positiv or negativ ( I don't remember exactly). I would add that using this source term seems very dangerous to me because it brakes the physic and it was much more correct to activate the compression term already implemented in OpenFOAM through the parameter calpha. in my case I finally used for the alpha solver : calpha = 1; nalphacorr = 0 for the first iterations (before the pression equation was stabilized (~ 50-100iterations) ) then 1 nalphasubcycle = 1 and i wasn't using a PIMPLE loop (noutercorrector = 1) hopfully it will help you, Quentin |
rsubdeltaT is the field containing the inverse of local time step (you have rdeltaT which is the inverse of main local time step and r subdeltaT is rDeltaT times bnalphasubcycle).
Regarding Su and Sp, in the "> 0.5" condition, the first part is implemented explicitely (Su) and the second implicitely (Sp). For the "<0.5" one, there is only an implicit part Sp and Su = 0. |
All times are GMT -4. The time now is 08:14. |