CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Pre-Processing (
-   -   Dynamic mesh, interDymFoam : refinement on 2 fields (

tek_cfd May 29, 2013 16:07

Dynamic mesh, interDymFoam : refinement on 2 fields
I would like to refine my mesh based on 2 fields variable (alpha1 and beta for example) at the same time using DynamicMeshDict how should I proceed.

// How often to refine
refineInterval 1;
// Field to be refinement on
field alpha1; // I would like to do it for beta at the same time as well!!
// Refine field inbetween lower..upper


Thanks very much in advance for any suggestion,

Phicau May 30, 2013 03:07


the most simple thing I can think of is creating a new field, let's call it "conditions" which can have value 1 if the conditions are fulfilled and 0 otherwise. After defining the "volScalarField conditions" in createFields.H you can access this new field from your solver. If you decide for example that alpha1 should be positive and beta negative:


conditions = pos(alpha1)*neg(beta);
which you can place in myInterDyMFoam.C. Then you can refine for values of "conditions" strictly greater than 0.

There is an option to include code on controlDict so it is compiled at runtime, I guess that you may place this code there instead of compiling a new solver. I've never used it, though, so I cannot help with that specifically.



All times are GMT -4. The time now is 20:35.