|
[Sponsors] |
August 10, 2017, 11:44 |
dynamicRefineFvMesh + Vorticity ?
|
#1 |
Member
badoumba
Join Date: Aug 2013
Posts: 68
Rep Power: 12 |
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 |
|
August 11, 2017, 03:49 |
|
#2 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20 |
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.) |
|
August 11, 2017, 06:07 |
|
#3 |
Member
badoumba
Join Date: Aug 2013
Posts: 68
Rep Power: 12 |
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 |
|
August 11, 2017, 07:24 |
|
#4 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20 |
As you can see in their examples:
https://github.com/tgvoskuilen/meshB...ynamicMeshDict They provide more options to dynamicRefineFvMesh, amongst which:
|
|
August 11, 2017, 18:38 |
|
#5 |
Member
badoumba
Join Date: Aug 2013
Posts: 68
Rep Power: 12 |
Hi Floquation,
Thanks for sharing. This refinementControls is definitely a great plus. I will give it a try this week-end. Thanks! |
|
August 13, 2017, 17:51 |
|
#6 |
Member
badoumba
Join Date: Aug 2013
Posts: 68
Rep Power: 12 |
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 |
|
August 14, 2017, 04:29 |
|
#7 | |||
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20 |
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(); label maxLevel = static_cast<label>(curlFields_[fldName].second()+0.5); 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 if( cellLevel[cellI] >= maxLevel ) refFld[cellI] = 0.5*(refinePoints.first() + refinePoints.second()) 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?) |
||||
August 14, 2017, 04:37 |
|
#8 |
Member
badoumba
Join Date: Aug 2013
Posts: 68
Rep Power: 12 |
Hi Floquation!
version is 17.06. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Choice of numerical schemes for high accuracy in vorticity | D.B | OpenFOAM Running, Solving & CFD | 1 | February 5, 2018 10:44 |
3D vorticity contour | shahzad_munir | Main CFD Forum | 0 | May 1, 2014 02:34 |
vorticity boundary condition | bearcharge | Main CFD Forum | 0 | May 14, 2010 11:32 |
vorticity calculation at symmetryplane | benconnell | OpenFOAM | 0 | April 14, 2009 18:45 |
Vorticity Iso-Surface | John | Main CFD Forum | 0 | April 4, 2009 23:10 |