View Issue Details

IDProjectCategoryView StatusLast Update
0001744OpenFOAM[All Projects] Bugpublic2015-06-15 16:51
Reporteruser1171Assigned Tohenry 
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version12.04
Product Version 
Fixed in Version 
Summary0001744: aachenBomb bug with dynamicRefineFvMesh
DescriptionWhen I add a dynamic mesh option to the aachenBomb tutotial, the drops start to behave really weirdly : it goes straights forward...

Originally I noticed this problem with a classic spray injection of n-heptane droplets. At the beginning, everything looks ok but as soon as the domain is refined during the simulation, the droplets behave strangely : it follows straight lines.

It is closely linked to the automatic refinement because when I turn it off and design a fine mesh from the very beginning instead, the bug doesn't appear anymore. Also because this bug appear just after the mesh refinement.
Steps To ReproduceAdd a dynamicMeshDict file in the constant directory of the aachenBomb totorial.


Include the dynamicFvMesh libraries in sprayFoam.C:

          #include "dynamicFvMesh.H"
          #include "createDynamicFvMesh.H"

Add the following lines to sprayFoam.C, right after parcels.evolve() :

    //start mesh refinement
    //*********************************************************
    scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
    // Do any mesh changes
    mesh.update();
    if (mesh.changing())
    {
        Info<< "Execution time for mesh.update() = "
        << runTime.elapsedCpuTime() - timeBeforeMeshUpdate
        << " s" << endl;
    }
    //*********************************************************
    //end mesh refinement
    //*********************************************************

Recompile the solver.

Launch the aachenBomb totorial with the new sprayFoam solver
TagsNo tags attached.

Activities

user1171

2015-06-15 16:37

 

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

dynamicFvMesh   dynamicRefineFvMesh;

dynamicRefineFvMeshCoeffs
{
    // How often to refine
    refineInterval  10;
    // Field to be refinement on
    field           MagnitudeVel;
    // Refine field inbetween lower..upper
    lowerRefineLevel 20;
    upperRefineLevel 400;
    // If value < unrefineLevel unrefine
    unrefineLevel   0;
    // Have slower than 2:1 refinement
    nBufferLayers   1;
    // Refine cells only up to maxRefinement levels
    maxRefinement  2;
    // Stop refinement if maxCells reached
    maxCells        5000000;
    // Flux field and corresponding velocity field. Fluxes on changed
    // faces get recalculated by interpolating the velocity.
    correctFluxes
    (
        (
            phi
            U
                )
  (
            phi
            Udrop
                )
    );
    // Write the refinement level as a volScalarField
    dumpLevel       true;
}


// ************************************************************************* //
dynamicMeshDict (1,778 bytes)

henry

2015-06-15 16:51

manager   ~0004932

sprayDyMFoam is already available in OpenFOAM-dev with associated updates and improvements to the handling of sprays with mesh refinement.

Issue History

Date Modified Username Field Change
2015-06-15 16:37 user1171 New Issue
2015-06-15 16:37 user1171 File Added: dynamicMeshDict
2015-06-15 16:51 henry Note Added: 0004932
2015-06-15 16:51 henry Status new => resolved
2015-06-15 16:51 henry Resolution open => fixed
2015-06-15 16:51 henry Assigned To => henry