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