mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Wave code tidying
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
DEV_PATH = ..
|
||||
|
||||
EXE_INC = \
|
||||
-DFULLDEBUG -g -O0 \
|
||||
-I$(DEV_PATH)/waveModel/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
|
||||
@ -26,26 +26,7 @@ License
|
||||
#include "waveAbsorptionOutletVelocityFvPatchVectorField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
|
||||
Foam::waveModel&
|
||||
Foam::waveAbsorptionOutletVelocityFvPatchVectorField::getWaveModel()
|
||||
{
|
||||
// Return waveModel from database if present, or create
|
||||
|
||||
if (!waveModel_.valid())
|
||||
{
|
||||
waveModel_ =
|
||||
waveModel::lookupOrCreate
|
||||
(
|
||||
patch().patch(),
|
||||
internalField().mesh(),
|
||||
waveDictName_
|
||||
);
|
||||
}
|
||||
|
||||
return waveModel_.ref();
|
||||
}
|
||||
|
||||
#include "waveModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -57,8 +38,7 @@ waveAbsorptionOutletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(p, iF),
|
||||
waveDictName_(waveModel::dictName),
|
||||
waveModelPtr_()
|
||||
waveDictName_(waveModel::dictName)
|
||||
{}
|
||||
|
||||
|
||||
@ -72,8 +52,7 @@ waveAbsorptionOutletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
|
||||
waveDictName_(ptf.waveDictName_),
|
||||
waveModelPtr_()
|
||||
waveDictName_(ptf.waveDictName_)
|
||||
{}
|
||||
|
||||
|
||||
@ -86,8 +65,7 @@ waveAbsorptionOutletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(p, iF, dict),
|
||||
waveDictName_(dict.lookupOrDefault<word>("waveDict", waveModel::dictName)),
|
||||
waveModelPtr_()
|
||||
waveDictName_(dict.lookupOrDefault<word>("waveDict", waveModel::dictName))
|
||||
{}
|
||||
|
||||
|
||||
@ -98,8 +76,7 @@ waveAbsorptionOutletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(ptf),
|
||||
waveDictName_(ptf.waveDictName_),
|
||||
waveModelPtr_()
|
||||
waveDictName_(ptf.waveDictName_)
|
||||
{}
|
||||
|
||||
|
||||
@ -111,8 +88,7 @@ waveAbsorptionOutletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(ptf, iF),
|
||||
waveDictName_(ptf.waveDictName_),
|
||||
waveModelPtr_()
|
||||
waveDictName_(ptf.waveDictName_)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -32,7 +32,6 @@ Description
|
||||
type waveAbsorptionOutletVelocity;
|
||||
waveDict wavesDict;
|
||||
value uniform (0 0 0);
|
||||
leftORright 1.0;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
@ -40,8 +39,7 @@ Usage
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
type | type: waveAbsorptionOutletVelocity | yes |
|
||||
waveDict | Dictionary where variables for generation/absorption are defined | yes | waveDict
|
||||
leftORright | Define location of Boundary condition: Left(1) or Right (-1) | yes | -1
|
||||
waveDict | Dictionary specifying wave variables | no | waveProperties
|
||||
\endtable
|
||||
|
||||
Note
|
||||
@ -58,7 +56,6 @@ SourceFiles
|
||||
#define waveAbsorptionOutletVelocityFvPatchVectorField_H
|
||||
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
#include "waveModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -77,12 +74,6 @@ class waveAbsorptionOutletVelocityFvPatchVectorField
|
||||
//- Dictionary name
|
||||
word waveDictName_;
|
||||
|
||||
//- Pointer to the wave model
|
||||
tmp<waveModel> waveModel_;
|
||||
|
||||
//- Help function to retrieve the wave model
|
||||
waveModel& getWaveModel();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -26,27 +26,7 @@ License
|
||||
#include "waveInletAlphaFvPatchScalarField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::waveModel& Foam::waveInletAlphaFvPatchScalarField::getWaveModel()
|
||||
{
|
||||
// Return waveModel from database if present, or create
|
||||
|
||||
if (!waveModel_.valid())
|
||||
{
|
||||
waveModel_ =
|
||||
waveModel::lookupOrCreate
|
||||
(
|
||||
patch().patch(),
|
||||
internalField().mesh(),
|
||||
waveDictName_
|
||||
);
|
||||
}
|
||||
|
||||
return waveModel_.ref();
|
||||
}
|
||||
|
||||
#include "waveModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -57,8 +37,7 @@ Foam::waveInletAlphaFvPatchScalarField::waveInletAlphaFvPatchScalarField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<scalar>(p, iF),
|
||||
waveDictName_(waveModel::dictName),
|
||||
waveModel_()
|
||||
waveDictName_(waveModel::dictName)
|
||||
{}
|
||||
|
||||
|
||||
@ -71,8 +50,7 @@ Foam::waveInletAlphaFvPatchScalarField::waveInletAlphaFvPatchScalarField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
|
||||
waveDictName_(ptf.waveDictName_),
|
||||
waveModel_()
|
||||
waveDictName_(ptf.waveDictName_)
|
||||
{}
|
||||
|
||||
|
||||
@ -84,8 +62,7 @@ Foam::waveInletAlphaFvPatchScalarField::waveInletAlphaFvPatchScalarField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<scalar>(p, iF, dict),
|
||||
waveDictName_(dict.lookupOrDefault<word>("waveDict", waveModel::dictName)),
|
||||
waveModel_()
|
||||
waveDictName_(dict.lookupOrDefault<word>("waveDict", waveModel::dictName))
|
||||
{}
|
||||
|
||||
|
||||
@ -95,8 +72,7 @@ Foam::waveInletAlphaFvPatchScalarField::waveInletAlphaFvPatchScalarField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<scalar>(ptf),
|
||||
waveDictName_(ptf.waveDictName_),
|
||||
waveModel_()
|
||||
waveDictName_(ptf.waveDictName_)
|
||||
{}
|
||||
|
||||
|
||||
@ -107,8 +83,7 @@ Foam::waveInletAlphaFvPatchScalarField::waveInletAlphaFvPatchScalarField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<scalar>(ptf, iF),
|
||||
waveDictName_(ptf.waveDictName_),
|
||||
waveModel_()
|
||||
waveDictName_(ptf.waveDictName_)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -32,7 +32,6 @@ Description
|
||||
{
|
||||
type waveInletAlpha;
|
||||
value uniform (0 0 0);
|
||||
leftORright 1.0;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
@ -41,7 +40,6 @@ Usage
|
||||
Property | Description | Required | Default value
|
||||
type | type: waveInletAlpha | yes |
|
||||
waveDict | Dictionary specifying wave variables | no | waveProperties
|
||||
leftORright | Define location of Boundary condition: Left(1) or Right (-1) | yes | -1
|
||||
\endtable
|
||||
|
||||
Note
|
||||
@ -58,7 +56,6 @@ SourceFiles
|
||||
#define waveInletAlphaFvPatchScalarField_H
|
||||
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
#include "waveModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -77,12 +74,6 @@ class waveInletAlphaFvPatchScalarField
|
||||
//- Dictionary name
|
||||
word waveDictName_;
|
||||
|
||||
//- Pointer to the wave model
|
||||
tmp<waveModel> waveModel_;
|
||||
|
||||
//- Help function to retrieve the wave model
|
||||
waveModel& getWaveModel();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -26,27 +26,7 @@ License
|
||||
#include "waveInletVelocityFvPatchVectorField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::waveModel& Foam::waveInletVelocityFvPatchVectorField::getWaveModel()
|
||||
{
|
||||
// Return waveModel from database if present, or create
|
||||
|
||||
if (!waveModel_.valid())
|
||||
{
|
||||
waveModel_ =
|
||||
waveModel::lookupOrCreate
|
||||
(
|
||||
patch().patch(),
|
||||
internalField().mesh(),
|
||||
waveDictName_
|
||||
);
|
||||
}
|
||||
|
||||
return waveModel_.ref();
|
||||
}
|
||||
|
||||
#include "waveModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -57,8 +37,7 @@ Foam::waveInletVelocityFvPatchVectorField::waveInletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(p, iF),
|
||||
waveDictName_(waveModel::dictName),
|
||||
waveModel_()
|
||||
waveDictName_(waveModel::dictName)
|
||||
{}
|
||||
|
||||
|
||||
@ -71,8 +50,7 @@ Foam::waveInletVelocityFvPatchVectorField::waveInletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
|
||||
waveDictName_(ptf.waveDictName_),
|
||||
waveModel_()
|
||||
waveDictName_(ptf.waveDictName_)
|
||||
{}
|
||||
|
||||
|
||||
@ -84,8 +62,7 @@ Foam::waveInletVelocityFvPatchVectorField::waveInletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(p, iF, dict),
|
||||
waveDictName_(dict.lookupOrDefault<word>("waveDict", waveModel::dictName)),
|
||||
waveModel_()
|
||||
waveDictName_(dict.lookupOrDefault<word>("waveDict", waveModel::dictName))
|
||||
{}
|
||||
|
||||
|
||||
@ -95,8 +72,7 @@ Foam::waveInletVelocityFvPatchVectorField::waveInletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(ptf),
|
||||
waveDictName_(ptf.waveDictName_),
|
||||
waveModel_()
|
||||
waveDictName_(ptf.waveDictName_)
|
||||
{}
|
||||
|
||||
|
||||
@ -107,8 +83,7 @@ Foam::waveInletVelocityFvPatchVectorField::waveInletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(ptf, iF),
|
||||
waveDictName_(ptf.waveDictName_),
|
||||
waveModel_()
|
||||
waveDictName_(ptf.waveDictName_)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -31,7 +31,6 @@ Description
|
||||
{
|
||||
type waveInletVelocity;
|
||||
value uniform (0 0 0);
|
||||
leftORright 1.0;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
@ -40,7 +39,6 @@ Usage
|
||||
Property | Description | Required | Default value
|
||||
type | type: waveInletVelocity | yes |
|
||||
waveDict | Dictionary specifying wave variables | no | waveProperties
|
||||
leftORright | Define location of Boundary condition: Left(1) or Right (-1) | yes | -1
|
||||
\endtable
|
||||
|
||||
Note
|
||||
@ -57,7 +55,6 @@ SourceFiles
|
||||
#define waveInletVelocityFvPatchVectorField_H
|
||||
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
#include "waveModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -76,12 +73,6 @@ class waveInletVelocityFvPatchVectorField
|
||||
//- Dictionary name
|
||||
word waveDictName_;
|
||||
|
||||
//- Pointer to the wave model
|
||||
tmp<waveModel> waveModel_;
|
||||
|
||||
//- Help function to retrieve the wave model
|
||||
waveModel& getWaveModel();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
EXE_INC = \
|
||||
-DFULLDEBUG -g -O0 \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
|
||||
@ -76,6 +76,7 @@ public:
|
||||
//- Destructor
|
||||
virtual ~waveAbsorptionModel();
|
||||
|
||||
|
||||
// Public Member Functions
|
||||
|
||||
//- Read from dictionary
|
||||
|
||||
@ -70,6 +70,7 @@ protected:
|
||||
//- Wave phase
|
||||
scalar wavePhase_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Return word description of wave type
|
||||
|
||||
Reference in New Issue
Block a user