Skip to content
Snippets Groups Projects
Commit 6b2de677 authored by Henry's avatar Henry Committed by Andrew Heather
Browse files

explicitPorositySource: Change field naming to support multiphase

parent 4be6f321
Branches
Tags
No related merge requests found
......@@ -45,10 +45,22 @@ namespace fv
}
}
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
void Foam::fv::explicitPorositySource::initialise()
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fv::explicitPorositySource::explicitPorositySource
(
const word& name,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
)
:
option(name, modelType, dict, mesh),
porosityPtr_(NULL)
{
read(dict);
if (selectionMode_ != smCellZone)
{
FatalErrorIn("void Foam::fv::explicitPorositySource::initialise()")
......@@ -66,61 +78,48 @@ void Foam::fv::explicitPorositySource::initialise()
coeffs_,
cellSetName_
).ptr()
),
fieldNames_.setSize(1, UName_);
applied_.setSize(1, false);
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::fv::explicitPorositySource::explicitPorositySource
void Foam::fv::explicitPorositySource::addSup
(
const word& name,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
fvMatrix<vector>& eqn,
const label fieldI
)
:
option(name, modelType, dict, mesh),
porosityPtr_(NULL),
UName_(coeffs_.lookupOrDefault<word>("UName", "U")),
muName_(coeffs_.lookupOrDefault<word>("muName", "thermo:mu"))
{
initialise();
fvMatrix<vector> porosityEqn(eqn.psi(), eqn.dimensions());
porosityPtr_->addResistance(porosityEqn);
eqn -= porosityEqn;
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::fv::explicitPorositySource::addSup
(
const volScalarField& rho,
fvMatrix<vector>& eqn,
const label fieldI
)
{
fvMatrix<vector> porosityEqn(eqn.psi(), eqn.dimensions());
porosityPtr_->addResistance(porosityEqn);
eqn -= porosityEqn;
}
void Foam::fv::explicitPorositySource::addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<vector>& eqn,
const label fieldI
)
{
fvMatrix<vector> porosityEqn(eqn.psi(), eqn.dimensions());
const volScalarField& mu = mesh_.lookupObject<volScalarField>(muName_);
porosityPtr_->addResistance(porosityEqn, rho, mu);
eqn -= porosityEqn;
porosityPtr_->addResistance(porosityEqn);
eqn -= alpha*porosityEqn;
}
......@@ -135,8 +134,21 @@ bool Foam::fv::explicitPorositySource::read(const dictionary& dict)
{
if (option::read(dict))
{
coeffs_.readIfPresent("UName", UName_);
coeffs_.readIfPresent("muName", muName_);
if (coeffs_.found("UNames"))
{
coeffs_.lookup("UNames") >> fieldNames_;
}
else if (coeffs_.found("UName"))
{
word UName(coeffs_.lookup("UName"));
fieldNames_ = wordList(1, UName);
}
else
{
fieldNames_ = wordList(1, "U");
}
applied_.setSize(fieldNames_.size(), false);
return true;
}
......
......@@ -34,6 +34,7 @@ Description
explicitPorositySourceCoeffs
{
type DarcyForchheimer;
DarcyForchheimerCoeffs
{
d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000);
......@@ -88,22 +89,6 @@ protected:
//- Run-time selectable porosity model
autoPtr<porosityModel> porosityPtr_;
//- Velocity field name, default = U
word UName_;
//- Density field name (compressible case only), default = rho
word rhoName_;
//- Dynamic viscosity field name (compressible case only)
// default = thermo:mu
word muName_;
// Protected Member Functions
//- Initialise
void initialise();
private:
......@@ -158,6 +143,15 @@ public:
const label fieldI
);
//- Add implicit contribution to phase momentum equation
virtual void addSup
(
const volScalarField& alpha,
const volScalarField& rho,
fvMatrix<vector>& eqn,
const label fieldI
);
// I-O
......
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