Commit 1ea4fc98 authored by Mark Olesen's avatar Mark Olesen
Browse files

BUG: incorrect boundary type for expressions variables (fixes #1889)

- had calculated boundaries (default) for the evaluated variables,
  which meant they retained their initialized values (usually Zero).

  This normally goes unnoticed, since the boundary values are largely
  irrelevant in the volField expressions. However, when applying
  functions that balk at a zero value - eg, log() - this raises a
  floating point exception.

  These boundary should be zeroGradient, since the evaluated variables
  correspond to the internalField only. Could continue to use
  calculated, but then need to set the calculated boundary values from
  the patch internal field manually.
parent e3ac8fb4
......@@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2010-2018 Bernhard Gschaider <bgschaid@hfd-research.com>
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -261,7 +261,14 @@ Foam::tmp<GeomField> Foam::expressions::fvExprDriver::getOrReadFieldImpl
tfield.reset
(
GeomField::New(name, meshRef, dimensioned<Type>(Zero))
GeomField::New
(
name,
meshRef,
dimensioned<Type>(Zero),
// Patch is zeroGradient (volFields) or calculated (other)
defaultBoundaryType(GeomField::null())
)
);
GeomField& fld = tfield.ref();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment