mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: improve volRegion handling of moving meshes (#1194)
- implemented as lazy evaluation with an additional update() method. This avoids unnecessary changes until the values are actually required. - apply mesh motion changes for momentum, volFieldValue, specieReactionRates function objects
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -229,12 +229,6 @@ Foam::functionObjects::fieldValues::volFieldValue::volFieldValue
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::functionObjects::fieldValues::volFieldValue::~volFieldValue()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::functionObjects::fieldValues::volFieldValue::read
|
||||
@ -251,6 +245,8 @@ bool Foam::functionObjects::fieldValues::volFieldValue::read
|
||||
|
||||
bool Foam::functionObjects::fieldValues::volFieldValue::write()
|
||||
{
|
||||
volRegion::update(); // Ensure cached values are valid
|
||||
|
||||
fieldValue::write();
|
||||
|
||||
if (Pstream::master())
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -272,7 +272,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~volFieldValue();
|
||||
virtual ~volFieldValue() = default;
|
||||
|
||||
|
||||
// Public Member Functions
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2015-2019 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -260,14 +260,12 @@ Foam::functionObjects::fieldValues::volFieldValue::filterField
|
||||
const Field<Type>& field
|
||||
) const
|
||||
{
|
||||
if (isNull(cellIDs()))
|
||||
if (volRegion::vrtAll == this->volRegion::regionType())
|
||||
{
|
||||
return field;
|
||||
}
|
||||
else
|
||||
{
|
||||
return tmp<Field<Type>>::New(field, cellIDs());
|
||||
}
|
||||
|
||||
return tmp<Field<Type>>::New(field, cellIDs());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user