multiphase: Update phase-naming to use the new convention e.g. alpha.water

This commit is contained in:
Henry
2013-08-13 23:21:46 +01:00
parent 208f63027d
commit 2780df8365
177 changed files with 313 additions and 622 deletions

View File

@ -39,7 +39,8 @@ Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
)
:
fixedValueFvPatchField<vector>(p, iF),
flowRate_(0)
flowRate_(0),
alphaName_("none")
{}
@ -53,7 +54,8 @@ Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
)
:
fixedValueFvPatchField<vector>(ptf, p, iF, mapper),
flowRate_(ptf.flowRate_)
flowRate_(ptf.flowRate_),
alphaName_(ptf.alphaName_)
{}
@ -66,7 +68,8 @@ Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
)
:
fixedValueFvPatchField<vector>(p, iF, dict),
flowRate_(readScalar(dict.lookup("flowRate")))
flowRate_(readScalar(dict.lookup("flowRate"))),
alphaName_(dict.lookup("alpha"))
{}
@ -77,7 +80,8 @@ Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
)
:
fixedValueFvPatchField<vector>(ptf),
flowRate_(ptf.flowRate_)
flowRate_(ptf.flowRate_),
alphaName_(ptf.alphaName_)
{}
@ -89,7 +93,8 @@ Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
)
:
fixedValueFvPatchField<vector>(ptf, iF),
flowRate_(ptf.flowRate_)
flowRate_(ptf.flowRate_),
alphaName_(ptf.alphaName_)
{}
@ -104,7 +109,7 @@ void Foam::variableHeightFlowRateInletVelocityFvPatchVectorField
}
scalarField alphap =
patch().lookupPatchField<volScalarField, scalar>("alpha1");
patch().lookupPatchField<volScalarField, scalar>(alphaName_);
alphap = max(alphap, scalar(0));
alphap = min(alphap, scalar(1));
@ -129,6 +134,8 @@ void Foam::variableHeightFlowRateInletVelocityFvPatchVectorField::write
os.writeKeyword("flowRate") << flowRate_
<< token::END_STATEMENT << nl;
os.writeKeyword("alpha") << alphaName_
<< token::END_STATEMENT << nl;
writeEntry("value", os);
}

View File

@ -39,6 +39,7 @@ Description
\table
Property | Description | Required | Default value
flowRate | volumetric flow rate [m3/s] | yes |
alpha | phase-fraction field | yes |
\endtable
Example of the boundary condition specification:
@ -47,6 +48,7 @@ Description
{
type variableHeightFlowRateInletVelocity;
flowRate 0.2;
alpha alpha.water;
value uniform (0 0 0); // placeholder
}
\endverbatim
@ -87,6 +89,9 @@ class variableHeightFlowRateInletVelocityFvPatchVectorField
//- Inlet integral flow rate
scalar flowRate_;
//- Name of the phase-fraction field
word alphaName_;
public:

View File

@ -53,9 +53,7 @@ void Foam::incompressibleTwoPhaseMixture::calcNu()
Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture
(
const volVectorField& U,
const surfaceScalarField& phi,
const word& alpha1Name,
const word& alpha2Name
const surfaceScalarField& phi
)
:
IOdictionary
@ -69,14 +67,14 @@ Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture
IOobject::NO_WRITE
)
),
twoPhaseMixture(U.mesh(), *this, alpha1Name, alpha2Name),
twoPhaseMixture(U.mesh(), *this),
nuModel1_
(
viscosityModel::New
(
"nu1",
subDict(phase1Name_ == "1" ? "phase1": phase1Name_),
subDict(phase1Name_),
U,
phi
)
@ -86,7 +84,7 @@ Foam::incompressibleTwoPhaseMixture::incompressibleTwoPhaseMixture
viscosityModel::New
(
"nu2",
subDict(phase2Name_ == "2" ? "phase2": phase2Name_),
subDict(phase2Name_),
U,
phi
)

View File

@ -86,9 +86,7 @@ public:
incompressibleTwoPhaseMixture
(
const volVectorField& U,
const surfaceScalarField& phi,
const word& alpha1Name = "alpha1",
const word& alpha2Name = "alpha2"
const surfaceScalarField& phi
);

View File

@ -31,29 +31,17 @@ License
Foam::twoPhaseMixture::twoPhaseMixture
(
const fvMesh& mesh,
const dictionary& dict,
const word& alpha1Name,
const word& alpha2Name
const dictionary& dict
)
:
phase1Name_
(
dict.found("phases")
? wordList(dict.lookup("phases"))[0]
: "1"
),
phase2Name_
(
dict.found("phases")
? wordList(dict.lookup("phases"))[1]
: "2"
),
phase1Name_(wordList(dict.lookup("phases"))[0]),
phase2Name_(wordList(dict.lookup("phases"))[1]),
alpha1_
(
IOobject
(
dict.found("phases") ? word("alpha" + phase1Name_) : alpha1Name,
IOobject::groupName("alpha", phase1Name_),
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
@ -66,7 +54,7 @@ Foam::twoPhaseMixture::twoPhaseMixture
(
IOobject
(
dict.found("phases") ? word("alpha" + phase2Name_) : alpha2Name,
IOobject::groupName("alpha", phase2Name_),
mesh.time().timeName(),
mesh
),

View File

@ -67,9 +67,7 @@ public:
twoPhaseMixture
(
const fvMesh& mesh,
const dictionary& dict,
const word& alpha1Name = "alpha1",
const word& alpha2Name = "alpha2"
const dictionary& dict
);