From 7e694ff53155a98a85e84948732aa1aad40a87d4 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 14 Feb 2011 17:47:17 +0000 Subject: [PATCH] ENH: porousExplicitSourceReactingParcelFoam: avoid nans --- .../filter/Allrun | 7 +- .../filter/system/changeDictionaryDict | 197 ++++++++++++++++++ .../filter/system/controlDict | 2 +- 3 files changed, 204 insertions(+), 2 deletions(-) create mode 100644 tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/changeDictionaryDict diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/Allrun b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/Allrun index cbb64d4d07..5929021b71 100755 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/Allrun +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/Allrun @@ -16,11 +16,16 @@ setSet -batch system/sets.setSet > log.setSet1 2>&1 setsToZones -noFlipMap > log.setsToZones 2>&1 # create the first cyclic - lhs of porous zone -unset FOAM_SETNAN +# Note that we don't know what value to give these patches-out-of-nothing so +# - use binary writing to avoid 'nan' +# - use setFields to set values +unset FOAM_SIGFPE createBaffles cycLeft '(cycLeft_half0 cycLeft_half1)' -overwrite > log.createBaffles1 2>&1 # create the second cyclic - rhs of porous zone createBaffles cycRight '(cycRight_half0 cycRight_half1)' -overwrite > log.createBaffles2 2>&1 +# Initialise newly created patchFields to 0 +changeDictionary runApplication $application diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/changeDictionaryDict b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/changeDictionaryDict new file mode 100644 index 0000000000..0f9c594877 --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/changeDictionaryDict @@ -0,0 +1,197 @@ +/*--------------------------------*- 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; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictionaryReplacement +{ + alphat + { + boundaryField + { + cycLeft + { + type cyclic; + value uniform 0; + } + cycRight + { + type cyclic; + value uniform 0; + } + } + } + epsilon + { + boundaryField + { + cycLeft + { + type cyclic; + value uniform 0; + } + cycRight + { + type cyclic; + value uniform 0; + } + } + } + G + { + boundaryField + { + cycLeft + { + type cyclic; + value uniform 0; + } + cycRight + { + type cyclic; + value uniform 0; + } + } + } + H2O + { + boundaryField + { + cycLeft + { + type cyclic; + value uniform 0; + } + cycRight + { + type cyclic; + value uniform 0; + } + } + } + k + { + boundaryField + { + cycLeft + { + type cyclic; + value uniform 0; + } + cycRight + { + type cyclic; + value uniform 0; + } + } + } + mut + { + boundaryField + { + cycLeft + { + type cyclic; + value uniform 0; + } + cycRight + { + type cyclic; + value uniform 0; + } + } + } + N2 + { + boundaryField + { + cycLeft + { + type cyclic; + value uniform 0; + } + cycRight + { + type cyclic; + value uniform 0; + } + } + } + O2 + { + boundaryField + { + cycLeft + { + type cyclic; + value uniform 0; + } + cycRight + { + type cyclic; + value uniform 0; + } + } + } + p + { + boundaryField + { + cycLeft + { + type cyclic; + value uniform 0; + } + cycRight + { + type cyclic; + value uniform 0; + } + } + } + T + { + boundaryField + { + cycLeft + { + type cyclic; + value uniform 0; + } + cycRight + { + type cyclic; + value uniform 0; + } + } + } + U + { + boundaryField + { + cycLeft + { + type cyclic; + value uniform (0 0 0); + } + cycRight + { + type cyclic; + value uniform (0 0 0); + } + } + } +} + +// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/controlDict b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/controlDict index 6190c66a07..a1620b8346 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/controlDict +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/system/controlDict @@ -33,7 +33,7 @@ writeInterval 0.1; purgeWrite 0; -writeFormat ascii; +writeFormat binary; writePrecision 10;