dynamicRefineFvMesh + Vorticity ?
Hi experts,
I try to make adaptive mesh refinement reacting to vorticity - no success so far. - Can I have vorticity declared as function object in ControlDict? What yould it look like? - Will it be registered in openFoam db() as required by dynamicRefineFvMesh? Could also be Q-criterion or Lambda2 instead of vorticity (as suggested here: https://www.vutbr.cz/www_base/zav_pr...file_id=148921) Thx |
Or you use a user extension that can do what you want:
https://github.com/tgvoskuilen/meshBalancing (It can refine based on the curl of volVectorFields, which is the vorticity when you apply it to U.) |
Hi Floquation,
What does this balancing brings on top of the std DynamicRefineFvMesh class? I think I can do the same with it. I just need to figure out where to set and link the vorticity/curl/Q... variable. Thx |
As you can see in their examples:
https://github.com/tgvoskuilen/meshB...ynamicMeshDict They provide more options to dynamicRefineFvMesh, amongst which:
|
Hi Floquation,
Thanks for sharing. This refinementControls is definitely a great plus. I will give it a try this week-end. Thanks! |
Hi Floquation,
I think I made all the necessary changes in my project including the refinement range. I suspect an error in the refinementControls. Is there any description somwhere for how to fill in params in RefinementControls section? I don't know exactly what the number means in U (0.5 1). Is Curls ( U(0.5 1)); the only thing I need for vorticity? Is there a need for SetFieldsDict? I don't think vorticity is available without running a specific function. What about if I want to try with Q criterion instead, is there any doc I can refer to for this? Many thx |
Quote:
Either way, to find out the answer to your question, we open the source code. cntrl+F for "curl". Then I spot the following two lines: Code:
scalar wgt = curlFields_[fldName].first(); Code:
refFld = wgt * mag(fvc::curl(fld)) * cubeRtV; This is specifically important if you want to combine multiple criteria, as those criteria are combined to a single field. If you do not weigh fields properly, one field might be negligible w.r.t. the others. A proper weight would be proportional to the inverse characteristic velocity, as then your refFld will be . Then, the latter (maxLevel), allows you to (code slightly adapted to illustrate the principle): Code:
// Limit the value of refFld based on its max level That is, that specific cell is forced inside the please-do-refine range. So if your field is larger than maxLevel, those cells will guaranteedly be refined. Quote:
You do not need setFieldsDict. It is in their example, because it is also possible to use a CellSet to base the refinement on - but you don't need that. Quote:
If you wish to use any other kind of math, you'll have to adapt the code for your purposes. (Perhaps my simpler code would be more useful for you in that case. What version do you use?) |
Hi Floquation!
version is 17.06. |
All times are GMT -4. The time now is 21:43. |