mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Adding lookupAndCheckout in basic thermo destructor to check out p field.
This was needed for application like postProcess.H in order to force the reading of thermal p on every time.
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -159,6 +159,15 @@ Foam::volScalarField& Foam::basicThermo::lookupOrConstruct
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::basicThermo::lookupAndCheckout(const char* name) const
|
||||||
|
{
|
||||||
|
if (db().foundObject<volScalarField>(name))
|
||||||
|
{
|
||||||
|
db().checkOut(*db()[name]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::basicThermo::basicThermo
|
Foam::basicThermo::basicThermo
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
@ -280,7 +289,9 @@ Foam::autoPtr<Foam::basicThermo> Foam::basicThermo::New
|
|||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::basicThermo::~basicThermo()
|
Foam::basicThermo::~basicThermo()
|
||||||
{}
|
{
|
||||||
|
lookupAndCheckout("p");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -83,12 +83,16 @@ protected:
|
|||||||
//- Construct as copy (not implemented)
|
//- Construct as copy (not implemented)
|
||||||
basicThermo(const basicThermo&);
|
basicThermo(const basicThermo&);
|
||||||
|
|
||||||
|
//- Look up or contruct field
|
||||||
volScalarField& lookupOrConstruct
|
volScalarField& lookupOrConstruct
|
||||||
(
|
(
|
||||||
const fvMesh& mesh,
|
const fvMesh& mesh,
|
||||||
const char* name
|
const char* name
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Lookup and check out field
|
||||||
|
void lookupAndCheckout(const char* name) const;
|
||||||
|
|
||||||
//- Return the enthalpy/internal energy field boundary types
|
//- Return the enthalpy/internal energy field boundary types
|
||||||
// by interrogating the temperature field boundary types
|
// by interrogating the temperature field boundary types
|
||||||
wordList heBoundaryTypes();
|
wordList heBoundaryTypes();
|
||||||
|
|||||||
Reference in New Issue
Block a user