Commit 22fd0edd authored by Henry Weller's avatar Henry Weller

porosityModels: Specification of name and dimensions of porosity coefficients is now optional

e.g.

    DarcyForchheimerCoeffs
    {
        d   (5e7 -1000 -1000);
        f   (0 0 0);

        coordinateSystem
        {
            type    cartesian;
            origin  (0 0 0);
            coordinateRotation
            {
                type    axesRotation;
                e1      (1 0 0);
                e2      (0 0 1);
            }
        }
    }
parent baa02e69
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -52,8 +52,8 @@ Foam::porosityModels::DarcyForchheimer::DarcyForchheimer
)
:
porosityModel(name, modelType, mesh, dict, cellZoneName),
dXYZ_(coeffs_.lookup("d")),
fXYZ_(coeffs_.lookup("f")),
dXYZ_("d", dimless/sqr(dimLength), coeffs_),
fXYZ_("f", dimless/dimLength, coeffs_),
D_(cellZoneIDs_.size()),
F_(cellZoneIDs_.size()),
rhoName_(coeffs_.lookupOrDefault<word>("rho", "rho")),
......
......@@ -70,8 +70,6 @@ class DarcyForchheimer
:
public porosityModel
{
private:
// Private data
//- Darcy coeffient XYZ components (user-supplied) [1/m2]
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -111,8 +111,8 @@ Foam::porosityModels::fixedCoeff::fixedCoeff
)
:
porosityModel(name, modelType, mesh, dict, cellZoneName),
alphaXYZ_(coeffs_.lookup("alpha")),
betaXYZ_(coeffs_.lookup("beta")),
alphaXYZ_("alpha", dimless/dimTime, coeffs_),
betaXYZ_("beta", dimless/dimLength, coeffs_),
alpha_(cellZoneIDs_.size()),
beta_(cellZoneIDs_.size())
{
......
......@@ -60,8 +60,6 @@ class fixedCoeff
:
public porosityModel
{
private:
// Private data
//- Alpha coefficient XYZ components (user-supplied) [1/s]
......
......@@ -57,8 +57,6 @@ class porosityModel
:
public regIOobject
{
private:
// Private Member Functions
//- Disallow default bitwise copy construct
......@@ -268,6 +266,7 @@ public:
virtual bool read(const dictionary& dict);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
......
......@@ -64,8 +64,6 @@ class powerLaw
:
public porosityModel
{
private:
// Private data
//- C0 coefficient
......
......@@ -30,6 +30,7 @@ License
#include "EulerDdtScheme.H"
#include "CrankNicolsonDdtScheme.H"
#include "backwardDdtScheme.H"
#include "localEulerDdtScheme.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......@@ -189,10 +190,11 @@ void Foam::advectiveFvPatchField<Type>::updateCoeffs()
return;
}
const fvMesh& mesh = this->dimensionedInternalField().mesh();
word ddtScheme
(
this->dimensionedInternalField().mesh()
.ddtScheme(this->dimensionedInternalField().name())
mesh.ddtScheme(this->dimensionedInternalField().name())
);
scalar deltaT = this->db().time().deltaTValue();
......@@ -243,6 +245,30 @@ void Foam::advectiveFvPatchField<Type>::updateCoeffs()
this->valueFraction() = (1.5 + k)/(1.5 + alpha + k);
}
else if
(
ddtScheme == fv::localEulerDdtScheme<scalar>::typeName
)
{
const volScalarField& rDeltaT =
fv::localEulerDdt::localRDeltaT(mesh);
// Calculate the field wave coefficient alpha (See notes)
const scalarField alpha
(
w*this->patch().deltaCoeffs()/rDeltaT.boundaryField()[patchi]
);
// Calculate the field relaxation coefficient k (See notes)
const scalarField k(w/(rDeltaT.boundaryField()[patchi]*lInf_));
this->refValue() =
(
field.oldTime().boundaryField()[patchi] + k*fieldInf_
)/(1.0 + k);
this->valueFraction() = (1.0 + k)/(1.0 + alpha + k);
}
else
{
FatalErrorInFunction
......@@ -275,6 +301,24 @@ void Foam::advectiveFvPatchField<Type>::updateCoeffs()
this->valueFraction() = 1.5/(1.5 + alpha);
}
else if
(
ddtScheme == fv::localEulerDdtScheme<scalar>::typeName
)
{
const volScalarField& rDeltaT =
fv::localEulerDdt::localRDeltaT(mesh);
// Calculate the field wave coefficient alpha (See notes)
const scalarField alpha
(
w*this->patch().deltaCoeffs()/rDeltaT.boundaryField()[patchi]
);
this->refValue() = field.oldTime().boundaryField()[patchi];
this->valueFraction() = 1.0/(1.0 + alpha);
}
else
{
FatalErrorInFunction
......
......@@ -31,7 +31,7 @@ Description
This boundary condition provides an advective outflow condition, based on
solving DDt(psi, U) = 0 at the boundary.
The standard (Euler, backward, CrankNicolson) time schemes are
The standard (Euler, backward, CrankNicolson, localEuler) time schemes are
supported. Additionally an optional mechanism to relax the value at
the boundary to a specified far-field value is provided which is
switched on by specifying the relaxation length-scale \c lInf and the
......
......@@ -29,8 +29,8 @@ porosity1
DarcyForchheimerCoeffs
{
d d [0 -2 0 0 0 0 0] (7e5 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0);
d (7e5 -1000 -1000);
f (0 0 0);
coordinateSystem
{
......
......@@ -29,8 +29,8 @@ porosity1
DarcyForchheimerCoeffs
{
d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0);
d (5e7 -1000 -1000);
f (0 0 0);
coordinateSystem
{
......
......@@ -29,8 +29,8 @@ porosity1
DarcyForchheimerCoeffs
{
d d [0 -2 0 0 0 0 0] (1e5 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0);
d (1e5 -1000 -1000);
f (0 0 0);
coordinateSystem
{
......
......@@ -23,8 +23,8 @@ porosity1
DarcyForchheimerCoeffs
{
d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0);
d (5e7 -1000 -1000);
f (0 0 0);
coordinateSystem
{
......
......@@ -45,8 +45,8 @@ porosity1
fixedCoeffCoeffs
{
alpha alpha [0 0 -1 0 0 0 0] (500 -1000 -1000);
beta beta [0 -1 0 0 0 0 0] (0 0 0);
alpha (500 -1000 -1000);
beta (0 0 0);
rhoRef 1;
coordinateSystem
......
......@@ -46,8 +46,8 @@ porosityBlockage
DarcyForchheimerCoeffs
{
d d [0 -2 0 0 0] (-1000 -1000 1e4);
f f [0 -1 0 0 0] (0 0 0);
d (-1000 -1000 1e4);
f (0 0 0);
coordinateSystem
{
......
......@@ -23,8 +23,8 @@ porosity1
DarcyForchheimerCoeffs
{
d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0);
d (5e7 -1000 -1000);
f (0 0 0);
coordinateSystem
{
......
......@@ -23,8 +23,8 @@ porosity1
DarcyForchheimerCoeffs
{
d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0);
d (5e7 -1000 -1000);
f (0 0 0);
coordinateSystem
{
......
......@@ -29,8 +29,8 @@ filter1
DarcyForchheimerCoeffs
{
d d [0 -2 0 0 0 0 0] (500000 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0);
d (500000 -1000 -1000);
f (0 0 0);
coordinateSystem
{
......
......@@ -29,8 +29,8 @@ porosity1
DarcyForchheimerCoeffs
{
d d [0 -2 0 0 0 0 0] (2e8 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0);
d (2e8 -1000 -1000);
f (0 0 0);
coordinateSystem
{
......
Markdown is supported
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