ENH: field source re-factoring
This commit is contained in:
@ -24,25 +24,29 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "pressureGradientExplicitSource.H"
|
||||
#include "volFields.H"
|
||||
#include "fvMatrices.H"
|
||||
#include "DimensionedField.H"
|
||||
#include "IFstream.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(pressureGradientExplicitSourceNew, 0);
|
||||
defineTypeNameAndDebug(pressureGradientExplicitSource, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
basicSource,
|
||||
pressureGradientExplicitSourceNew,
|
||||
pressureGradientExplicitSource,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::pressureGradientExplicitSourceNew::writeGradP() const
|
||||
void Foam::pressureGradientExplicitSource::writeGradP() const
|
||||
{
|
||||
// Only write on output time
|
||||
if (mesh_.time().outputTime())
|
||||
@ -65,7 +69,7 @@ void Foam::pressureGradientExplicitSourceNew::writeGradP() const
|
||||
}
|
||||
|
||||
|
||||
void Foam::pressureGradientExplicitSourceNew::update()
|
||||
void Foam::pressureGradientExplicitSource::update()
|
||||
{
|
||||
volVectorField& U = const_cast<volVectorField&>
|
||||
(
|
||||
@ -117,7 +121,7 @@ void Foam::pressureGradientExplicitSourceNew::update()
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::pressureGradientExplicitSourceNew::pressureGradientExplicitSourceNew
|
||||
Foam::pressureGradientExplicitSource::pressureGradientExplicitSource
|
||||
(
|
||||
const word& sourceName,
|
||||
const word& modelType,
|
||||
@ -151,7 +155,7 @@ Foam::pressureGradientExplicitSourceNew::pressureGradientExplicitSourceNew
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::pressureGradientExplicitSourceNew::applyToField
|
||||
Foam::label Foam::pressureGradientExplicitSource::applyToField
|
||||
(
|
||||
const word& fieldName
|
||||
) const
|
||||
@ -167,7 +171,7 @@ Foam::label Foam::pressureGradientExplicitSourceNew::applyToField
|
||||
}
|
||||
|
||||
|
||||
void Foam::pressureGradientExplicitSourceNew::addSup
|
||||
void Foam::pressureGradientExplicitSource::addSup
|
||||
(
|
||||
fvMatrix<vector>& eqn,
|
||||
const label
|
||||
|
||||
@ -22,20 +22,31 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::pressureGradientExplicitSourceNew
|
||||
Foam::pressureGradientExplicitSource
|
||||
|
||||
Description
|
||||
Creates a cell set pressure gradient source
|
||||
Creates a pressure gradient source
|
||||
|
||||
Note: Currently only handles kinematic pressure
|
||||
|
||||
Sources described by:
|
||||
|
||||
pressureGradientExplicitSourceCoeffs
|
||||
{
|
||||
UName U; // Name of velocity field
|
||||
Ubar (10.0 0 0); // Desired average velocity
|
||||
gradPini gradPini [0 2 -2 0 0]; // initial pressure gradient
|
||||
flowDir (1 0 0); // flow direction
|
||||
}
|
||||
|
||||
|
||||
SourceFiles
|
||||
pressureGradientExplicitSourceNew.C
|
||||
pressureGradientExplicitSource.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef pressureGradientExplicitSourceNew_H
|
||||
#define pressureGradientExplicitSourceNew_H
|
||||
#ifndef pressureGradientExplicitSource_H
|
||||
#define pressureGradientExplicitSource_H
|
||||
|
||||
#include "autoPtr.H"
|
||||
#include "topoSetSource.H"
|
||||
@ -50,10 +61,10 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class pressureGradientExplicitSourceNew Declaration
|
||||
Class pressureGradientExplicitSource Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class pressureGradientExplicitSourceNew
|
||||
class pressureGradientExplicitSource
|
||||
:
|
||||
public basicSource
|
||||
{
|
||||
@ -84,10 +95,10 @@ class pressureGradientExplicitSourceNew
|
||||
void update();
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
pressureGradientExplicitSourceNew(const pressureGradientExplicitSourceNew&);
|
||||
pressureGradientExplicitSource(const pressureGradientExplicitSource&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const pressureGradientExplicitSourceNew&);
|
||||
void operator=(const pressureGradientExplicitSource&);
|
||||
|
||||
|
||||
public:
|
||||
@ -99,7 +110,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from explicit source name and mesh
|
||||
pressureGradientExplicitSourceNew
|
||||
pressureGradientExplicitSource
|
||||
(
|
||||
const word& sourceName,
|
||||
const word& modelType,
|
||||
|
||||
@ -27,11 +27,11 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::pressureGradientExplicitSourceNew::writeData(Ostream& os) const
|
||||
void Foam::pressureGradientExplicitSource::writeData(Ostream& os) const
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"void Foam::pressureGradientExplicitSourceNew::writeData"
|
||||
"void Foam::pressureGradientExplicitSource::writeData"
|
||||
"("
|
||||
"Ostream&"
|
||||
") const"
|
||||
@ -39,11 +39,11 @@ void Foam::pressureGradientExplicitSourceNew::writeData(Ostream& os) const
|
||||
}
|
||||
|
||||
|
||||
bool Foam::pressureGradientExplicitSourceNew::read(const dictionary& dict)
|
||||
bool Foam::pressureGradientExplicitSource::read(const dictionary& dict)
|
||||
{
|
||||
notImplemented
|
||||
(
|
||||
"bool Foam::pressureGradientExplicitSourceNew::read"
|
||||
"bool Foam::pressureGradientExplicitSource::read"
|
||||
"("
|
||||
"const dictionary&"
|
||||
") const"
|
||||
|
||||
Reference in New Issue
Block a user