CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Dynamic mesh refinement failing in interFoam (https://www.cfd-online.com/Forums/openfoam-solving/241964-dynamic-mesh-refinement-failing-interfoam.html)

Venky_94 March 29, 2022 17:17

Dynamic mesh refinement failing in interFoam
 
I'm running a simple bubble growth case, which is running perfectly fine without the dynamic mesh refinement. I'm using a grid size of 0.02*0.02mm generated by blockMesh for the simulation.

I've adaptive time stepping turned on with a maxCo set at 0.5, while running with the dynamicMeshDict, I'm noticing that the deltaT starts dropping drastically after a point (upto 1e-53 or 1e-119) and the program crashes with floating point exception error. Also even while the program is running normally, the deltaT is much higher than a much finer grid (around 2 e-7).

I've run with a fine grid of 0.01*0.01mm generated by blockMesh without dynamic mesh and it's running perfectly fine, and the average deltaT is also higher (around 2e-6).

I'm sharing my dynamicMeshDict here. I'd really appreciate if someone could share their inputs. I see that a lot of them are facing the same issue with dynamic mesh refinement but there has been no resolution posted.

Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  9
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class      dictionary;
    location    "constant";
    object      dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh  dynamicRefineFvMesh;

// How often to refine
refineInterval  5;

// Field to be refinement on
field          alpha.water;

// Refine field in between lower..upper
lowerRefineLevel 0.001;
upperRefineLevel 0.999;

// If value < unrefineLevel unrefine
unrefineLevel  0.001;

// Have slower than 2:1 refinement
nBufferLayers  3;

// Refine cells only up to maxRefinement levels
maxRefinement  1;

// Stop refinement if maxCells reached
maxCells        250000;

// Flux field and corresponding velocity field. Fluxes on changed
// faces get recalculated by interpolating the velocity. Use 'none'
// on surfaceScalarFields that do not need to be reinterpolated.
correctFluxes
(
    (phi none)
    (nHatf none)
    (rhoPhi none)
    (alphaPhi0.water none)
    (ghf none)
);

// Write the refinement level as a volScalarField
dumpLevel      true;


// ************************************************************************* //


al.csc July 17, 2022 05:16

Simple guess: are you running a 3D refinement in a 2D case?

HY DING April 24, 2024 07:12

dynamicmeshDict can not be used in 2D cases.


All times are GMT -4. The time now is 22:04.