mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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.
This commit is contained in:
@ -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();
|
||||
|
||||
Reference in New Issue
Block a user