mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
This is controlled by providing a list of the fields to be cached in the "cache" sub-dictionary of fvSolution. Debug information about the caching is printed when the solution::debug switch is on. There are still a couple of issues to do with the naming of gradients used in corrected snGrads and limited interpolation schemes that need to be resolved but these are no different to previously and hence not urgent.
164 lines
4.4 KiB
C++
164 lines
4.4 KiB
C++
/*---------------------------------------------------------------------------*\
|
|
========= |
|
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
\\ / O peration |
|
|
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
|
\\/ M anipulation |
|
|
-------------------------------------------------------------------------------
|
|
License
|
|
This file is part of OpenFOAM.
|
|
|
|
OpenFOAM is free software; you can redistribute it and/or modify it
|
|
under the terms of the GNU General Public License as published by the
|
|
Free Software Foundation; either version 2 of the License, or (at your
|
|
option) any later version.
|
|
|
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
Class
|
|
Foam::linearUpwindV
|
|
|
|
Description
|
|
linearUpwindV interpolation scheme class derived from upwind and returns
|
|
upwind weighting factors but also applies an explicit correction.
|
|
|
|
SourceFiles
|
|
linearUpwindV.C
|
|
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
#ifndef linearUpwindV_H
|
|
#define linearUpwindV_H
|
|
|
|
#include "upwind.H"
|
|
#include "gaussGrad.H"
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
namespace Foam
|
|
{
|
|
|
|
/*---------------------------------------------------------------------------*\
|
|
Class linearUpwindV Declaration
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
template<class Type>
|
|
class linearUpwindV
|
|
:
|
|
public upwind<Type>
|
|
{
|
|
// Private Data
|
|
|
|
word gradSchemeName_;
|
|
tmp<fv::gradScheme<Type> > gradScheme_;
|
|
|
|
|
|
// Private Member Functions
|
|
|
|
//- Disallow default bitwise copy construct
|
|
linearUpwindV(const linearUpwindV&);
|
|
|
|
//- Disallow default bitwise assignment
|
|
void operator=(const linearUpwindV&);
|
|
|
|
|
|
public:
|
|
|
|
//- Runtime type information
|
|
TypeName("linearUpwindV");
|
|
|
|
|
|
// Constructors
|
|
|
|
//- Construct from faceFlux
|
|
linearUpwindV
|
|
(
|
|
const fvMesh& mesh,
|
|
const surfaceScalarField& faceFlux
|
|
)
|
|
:
|
|
upwind<Type>(mesh, faceFlux),
|
|
gradSchemeName_("grad"),
|
|
gradScheme_
|
|
(
|
|
new fv::gaussGrad<Type>(mesh)
|
|
)
|
|
{}
|
|
|
|
//- Construct from Istream.
|
|
// The name of the flux field is read from the Istream and looked-up
|
|
// from the mesh objectRegistry
|
|
linearUpwindV
|
|
(
|
|
const fvMesh& mesh,
|
|
Istream& schemeData
|
|
)
|
|
:
|
|
upwind<Type>(mesh, schemeData),
|
|
gradSchemeName_(schemeData),
|
|
gradScheme_
|
|
(
|
|
fv::gradScheme<Type>::New
|
|
(
|
|
mesh,
|
|
mesh.gradScheme(gradSchemeName_)
|
|
)
|
|
)
|
|
{}
|
|
|
|
//- Construct from faceFlux and Istream
|
|
linearUpwindV
|
|
(
|
|
const fvMesh& mesh,
|
|
const surfaceScalarField& faceFlux,
|
|
Istream& schemeData
|
|
)
|
|
:
|
|
upwind<Type>(mesh, faceFlux, schemeData),
|
|
gradSchemeName_(schemeData),
|
|
gradScheme_
|
|
(
|
|
fv::gradScheme<Type>::New
|
|
(
|
|
mesh,
|
|
mesh.gradScheme(gradSchemeName_)
|
|
)
|
|
)
|
|
{}
|
|
|
|
|
|
// Member Functions
|
|
|
|
//- Return true if this scheme uses an explicit correction
|
|
virtual bool corrected() const
|
|
{
|
|
return true;
|
|
}
|
|
|
|
//- Return the explicit correction to the face-interpolate
|
|
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
|
|
correction
|
|
(
|
|
const GeometricField<Type, fvPatchField, volMesh>&
|
|
) const;
|
|
|
|
};
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
} // End namespace Foam
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
#endif
|
|
|
|
// ************************************************************************* //
|