CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Adaptive Mesh Refinement and Custom Field Variables (https://www.cfd-online.com/Forums/openfoam/221671-adaptive-mesh-refinement-custom-field-variables.html)

hconel October 24, 2019 17:50

Adaptive Mesh Refinement and Custom Field Variables
 
Hello,
I have started using OpenFOAM's AMR feature recently. Although I am a total newbie, so far, I am able to use dynamicRefineFvMesh with pimpleDyMFoam. My understanding is that one can set a field (say, pressure) as the reference for refinement and also set a value interval for that field variable to do refinements on.
The first thing I know about ARM is that the refinement should be done on regions where the gradient of a varible is the highest, instead of the value itself of that variable. That being said, I am looking for a way to set the gradient of a field variable as the refinement parameter. Can I do that with a direct input such as:

field grad(p);

in dynamicMeshDict, or should I create a new field variable which would yield the pressure gradient magnitude first? If so, how can I do that?

Thanks in advance,
Hüseyin


All times are GMT -4. The time now is 10:36.