ENH: dynamicRefineFvMesh: added option for NaN

This commit is contained in:
mattijs
2013-09-20 17:29:08 +01:00
parent 988bcdbd5f
commit 096ff01e52
2 changed files with 45 additions and 1 deletions

View File

@ -31,6 +31,7 @@ License
#include "surfaceFields.H"
#include "syncTools.H"
#include "pointFields.H"
#include "sigFpe.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -329,6 +330,18 @@ Foam::dynamicRefineFvMesh::refine
continue;
}
if (UName == "NaN")
{
Pout<< "Setting surfaceScalarField " << iter.key()
<< " to NaN" << endl;
surfaceScalarField& phi = *iter();
sigFpe::fillSignallingNan(phi.internalField());
continue;
}
if (debug)
{
Pout<< "Mapping flux " << iter.key()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,6 +29,37 @@ Description
Determines which cells to refine/unrefine and does all in update().
// How often to refine
refineInterval 1;
// Field to be refinement on
field alpha.water;
// Refine field inbetween lower..upper
lowerRefineLevel 0.001;
upperRefineLevel 0.999;
// If value < unrefineLevel unrefine
unrefineLevel 10;
// Have slower than 2:1 refinement
nBufferLayers 1;
// Refine cells only up to maxRefinement levels
maxRefinement 2;
// Stop refinement if maxCells reached
maxCells 200000;
// 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, use
// NaN to detect use of mapped variable
correctFluxes
(
(phi none) //NaN) //none)
(nHatf none) //none)
(rho*phi none) //none)
(ghf none) //NaN) //none)
);
// Write the refinement level as a volScalarField
dumpLevel true;
SourceFiles
dynamicRefineFvMesh.C