Commit 3a394556 authored by Andrew Heather's avatar Andrew Heather
Browse files

adding option to specify name of compressibility field - defaults to psi

parent cd7fe7c8
......@@ -31,13 +31,16 @@ License
namespace Foam
{
namespace compressibilityModels
{
defineTypeNameAndDebug(Chung, 0);
addToRunTimeSelectionTable(barotropicCompressibilityModel, Chung, dictionary);
}
namespace compressibilityModels
{
defineTypeNameAndDebug(Chung, 0);
addToRunTimeSelectionTable
(
barotropicCompressibilityModel,
Chung,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......@@ -45,10 +48,11 @@ addToRunTimeSelectionTable(barotropicCompressibilityModel, Chung, dictionary);
Foam::compressibilityModels::Chung::Chung
(
const dictionary& compressibilityProperties,
const volScalarField& gamma
const volScalarField& gamma,
const word& psiName
)
:
barotropicCompressibilityModel(compressibilityProperties, gamma),
barotropicCompressibilityModel(compressibilityProperties, gamma, psiName),
psiv_(compressibilityProperties_.lookup("psiv")),
psil_(compressibilityProperties_.lookup("psil")),
rhovSat_(compressibilityProperties_.lookup("rhovSat")),
......
......@@ -75,7 +75,8 @@ public:
Chung
(
const dictionary& compressibilityProperties,
const volScalarField& gamma
const volScalarField& gamma,
const word& psiName = "psi"
);
......
......@@ -31,13 +31,16 @@ License
namespace Foam
{
namespace compressibilityModels
{
defineTypeNameAndDebug(Wallis, 0);
addToRunTimeSelectionTable(barotropicCompressibilityModel, Wallis, dictionary);
}
namespace compressibilityModels
{
defineTypeNameAndDebug(Wallis, 0);
addToRunTimeSelectionTable
(
barotropicCompressibilityModel,
Wallis,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......@@ -45,10 +48,11 @@ addToRunTimeSelectionTable(barotropicCompressibilityModel, Wallis, dictionary);
Foam::compressibilityModels::Wallis::Wallis
(
const dictionary& compressibilityProperties,
const volScalarField& gamma
const volScalarField& gamma,
const word& psiName
)
:
barotropicCompressibilityModel(compressibilityProperties, gamma),
barotropicCompressibilityModel(compressibilityProperties, gamma, psiName),
psiv_(compressibilityProperties_.lookup("psiv")),
psil_(compressibilityProperties_.lookup("psil")),
rhovSat_(compressibilityProperties_.lookup("rhovSat")),
......@@ -62,8 +66,9 @@ Foam::compressibilityModels::Wallis::Wallis
void Foam::compressibilityModels::Wallis::correct()
{
psi_ = (gamma_*rhovSat_ + (scalar(1) - gamma_)*rholSat_)
*(gamma_*psiv_/rhovSat_ + (scalar(1) - gamma_)*psil_/rholSat_);
psi_ =
(gamma_*rhovSat_ + (scalar(1) - gamma_)*rholSat_)
*(gamma_*psiv_/rhovSat_ + (scalar(1) - gamma_)*psil_/rholSat_);
}
......
......@@ -75,7 +75,8 @@ public:
Wallis
(
const dictionary& compressibilityProperties,
const volScalarField& gamma
const volScalarField& gamma,
const word& psiName = "psi"
);
......
......@@ -42,7 +42,8 @@ namespace Foam
Foam::barotropicCompressibilityModel::barotropicCompressibilityModel
(
const dictionary& compressibilityProperties,
const volScalarField& gamma
const volScalarField& gamma,
const word& psiName
)
:
compressibilityProperties_(compressibilityProperties),
......@@ -50,12 +51,12 @@ Foam::barotropicCompressibilityModel::barotropicCompressibilityModel
(
IOobject
(
"psi",
psiName,
gamma.mesh().time().timeName(),
gamma.mesh()
),
gamma.mesh(),
dimensionedScalar("psi", dimensionSet(0, -2, 2, 0, 0), 0)
dimensionedScalar(psiName, dimensionSet(0, -2, 2, 0, 0), 0)
),
gamma_(gamma)
{}
......
......@@ -97,9 +97,10 @@ public:
dictionary,
(
const dictionary& compressibilityProperties,
const volScalarField& gamma
const volScalarField& gamma,
const word& psiName
),
(compressibilityProperties, gamma)
(compressibilityProperties, gamma, psiName)
);
......@@ -109,7 +110,8 @@ public:
static autoPtr<barotropicCompressibilityModel> New
(
const dictionary& compressibilityProperties,
const volScalarField& gamma
const volScalarField& gamma,
const word& psiName = "psi"
);
......@@ -119,7 +121,8 @@ public:
barotropicCompressibilityModel
(
const dictionary& compressibilityProperties,
const volScalarField& gamma
const volScalarField& gamma,
const word& psiName = "psi"
);
......
......@@ -32,7 +32,8 @@ Foam::autoPtr<Foam::barotropicCompressibilityModel>
Foam::barotropicCompressibilityModel::New
(
const dictionary& compressibilityProperties,
const volScalarField& gamma
const volScalarField& gamma,
const word& psiName
)
{
word bcModelTypeName
......@@ -60,7 +61,7 @@ Foam::barotropicCompressibilityModel::New
return autoPtr<barotropicCompressibilityModel>
(
cstrIter()(compressibilityProperties, gamma)
cstrIter()(compressibilityProperties, gamma, psiName)
);
}
......
......@@ -31,13 +31,16 @@ License
namespace Foam
{
namespace compressibilityModels
{
defineTypeNameAndDebug(linear, 0);
addToRunTimeSelectionTable(barotropicCompressibilityModel, linear, dictionary);
}
namespace compressibilityModels
{
defineTypeNameAndDebug(linear, 0);
addToRunTimeSelectionTable
(
barotropicCompressibilityModel,
linear,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......@@ -45,10 +48,11 @@ addToRunTimeSelectionTable(barotropicCompressibilityModel, linear, dictionary);
Foam::compressibilityModels::linear::linear
(
const dictionary& compressibilityProperties,
const volScalarField& gamma
const volScalarField& gamma,
const word& psiName
)
:
barotropicCompressibilityModel(compressibilityProperties, gamma),
barotropicCompressibilityModel(compressibilityProperties, gamma, psiName),
psiv_(compressibilityProperties_.lookup("psiv")),
psil_(compressibilityProperties_.lookup("psil"))
{
......
......@@ -72,7 +72,8 @@ public:
linear
(
const dictionary& compressibilityProperties,
const volScalarField& gamma
const volScalarField& gamma,
const word& psiName = "psi"
);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment