/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2012                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant/fluid";
    object      dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMeshLibs ("libnewDynamicFvMesh.so");

// dynamicFvMesh   dynamicRefine2DMotionSolverFvMesh;
dynamicFvMesh   dynamicMotionSolverFvMesh;

motionSolverLibs ( "libnewFvMotionSolver.so" );

motionSolver newDisplacementLaplacian;

newDisplacementLaplacianCoeffs
{
    nCorrectors 10;
    convergenceTolerance 1e-10;
    diffusivity  quadratic inverseDistance 1(InterfaceFluid);
}

dynamicRefine2DMotionSolverFvMeshCoeffs
{
    nBufferLayersR 3;

    // How often to refine
    refineInterval  15;

    // Field to be refinement on
    field           magGradRhoNorm;

    // Refine field inbetween lower..upper
    lowerRefineLevel 0.05;
    upperRefineLevel 1.0;

    // If value < unrefineLevel unrefine
    unrefineLevel   0.01;

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

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

    // Stop refinement if maxCells reached
    maxCells        1000000;

    // 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)
    );

    // Tag all wall patch as protected cell. Those cells won't be refined.
    protectWall true;
    protectedWall (InterfaceFluid);
    distance 0.11;

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


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