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);
            }
        }
    }
This commit is contained in:
Henry Weller
2015-11-17 12:05:57 +00:00
parent baa02e6916
commit 22fd0edd59
18 changed files with 78 additions and 41 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -52,8 +52,8 @@ Foam::porosityModels::DarcyForchheimer::DarcyForchheimer
) )
: :
porosityModel(name, modelType, mesh, dict, cellZoneName), porosityModel(name, modelType, mesh, dict, cellZoneName),
dXYZ_(coeffs_.lookup("d")), dXYZ_("d", dimless/sqr(dimLength), coeffs_),
fXYZ_(coeffs_.lookup("f")), fXYZ_("f", dimless/dimLength, coeffs_),
D_(cellZoneIDs_.size()), D_(cellZoneIDs_.size()),
F_(cellZoneIDs_.size()), F_(cellZoneIDs_.size()),
rhoName_(coeffs_.lookupOrDefault<word>("rho", "rho")), rhoName_(coeffs_.lookupOrDefault<word>("rho", "rho")),

View File

@ -70,8 +70,6 @@ class DarcyForchheimer
: :
public porosityModel public porosityModel
{ {
private:
// Private data // Private data
//- Darcy coeffient XYZ components (user-supplied) [1/m2] //- Darcy coeffient XYZ components (user-supplied) [1/m2]

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -111,8 +111,8 @@ Foam::porosityModels::fixedCoeff::fixedCoeff
) )
: :
porosityModel(name, modelType, mesh, dict, cellZoneName), porosityModel(name, modelType, mesh, dict, cellZoneName),
alphaXYZ_(coeffs_.lookup("alpha")), alphaXYZ_("alpha", dimless/dimTime, coeffs_),
betaXYZ_(coeffs_.lookup("beta")), betaXYZ_("beta", dimless/dimLength, coeffs_),
alpha_(cellZoneIDs_.size()), alpha_(cellZoneIDs_.size()),
beta_(cellZoneIDs_.size()) beta_(cellZoneIDs_.size())
{ {

View File

@ -60,8 +60,6 @@ class fixedCoeff
: :
public porosityModel public porosityModel
{ {
private:
// Private data // Private data
//- Alpha coefficient XYZ components (user-supplied) [1/s] //- Alpha coefficient XYZ components (user-supplied) [1/s]

View File

@ -57,8 +57,6 @@ class porosityModel
: :
public regIOobject public regIOobject
{ {
private:
// Private Member Functions // Private Member Functions
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
@ -268,6 +266,7 @@ public:
virtual bool read(const dictionary& dict); virtual bool read(const dictionary& dict);
}; };
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam } // End namespace Foam

View File

@ -64,8 +64,6 @@ class powerLaw
: :
public porosityModel public porosityModel
{ {
private:
// Private data // Private data
//- C0 coefficient //- C0 coefficient

View File

@ -30,6 +30,7 @@ License
#include "EulerDdtScheme.H" #include "EulerDdtScheme.H"
#include "CrankNicolsonDdtScheme.H" #include "CrankNicolsonDdtScheme.H"
#include "backwardDdtScheme.H" #include "backwardDdtScheme.H"
#include "localEulerDdtScheme.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -189,10 +190,11 @@ void Foam::advectiveFvPatchField<Type>::updateCoeffs()
return; return;
} }
const fvMesh& mesh = this->dimensionedInternalField().mesh();
word ddtScheme word ddtScheme
( (
this->dimensionedInternalField().mesh() mesh.ddtScheme(this->dimensionedInternalField().name())
.ddtScheme(this->dimensionedInternalField().name())
); );
scalar deltaT = this->db().time().deltaTValue(); scalar deltaT = this->db().time().deltaTValue();
@ -243,6 +245,30 @@ void Foam::advectiveFvPatchField<Type>::updateCoeffs()
this->valueFraction() = (1.5 + k)/(1.5 + alpha + k); 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 else
{ {
FatalErrorInFunction FatalErrorInFunction
@ -275,6 +301,24 @@ void Foam::advectiveFvPatchField<Type>::updateCoeffs()
this->valueFraction() = 1.5/(1.5 + alpha); 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 else
{ {
FatalErrorInFunction FatalErrorInFunction

View File

@ -31,7 +31,7 @@ Description
This boundary condition provides an advective outflow condition, based on This boundary condition provides an advective outflow condition, based on
solving DDt(psi, U) = 0 at the boundary. 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 supported. Additionally an optional mechanism to relax the value at
the boundary to a specified far-field value is provided which is the boundary to a specified far-field value is provided which is
switched on by specifying the relaxation length-scale \c lInf and the switched on by specifying the relaxation length-scale \c lInf and the

View File

@ -29,8 +29,8 @@ porosity1
DarcyForchheimerCoeffs DarcyForchheimerCoeffs
{ {
d d [0 -2 0 0 0 0 0] (7e5 -1000 -1000); d (7e5 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0); f (0 0 0);
coordinateSystem coordinateSystem
{ {
@ -39,8 +39,8 @@ porosity1
coordinateRotation coordinateRotation
{ {
type axesRotation; type axesRotation;
e1 (0.70710678 0.70710678 0); e1 (0.70710678 0.70710678 0);
e3 (0 0 1); e3 (0 0 1);
} }
} }
} }

View File

@ -29,8 +29,8 @@ porosity1
DarcyForchheimerCoeffs DarcyForchheimerCoeffs
{ {
d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000); d (5e7 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0); f (0 0 0);
coordinateSystem coordinateSystem
{ {

View File

@ -29,8 +29,8 @@ porosity1
DarcyForchheimerCoeffs DarcyForchheimerCoeffs
{ {
d d [0 -2 0 0 0 0 0] (1e5 -1000 -1000); d (1e5 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0); f (0 0 0);
coordinateSystem coordinateSystem
{ {

View File

@ -23,8 +23,8 @@ porosity1
DarcyForchheimerCoeffs DarcyForchheimerCoeffs
{ {
d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000); d (5e7 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0); f (0 0 0);
coordinateSystem coordinateSystem
{ {

View File

@ -45,8 +45,8 @@ porosity1
fixedCoeffCoeffs fixedCoeffCoeffs
{ {
alpha alpha [0 0 -1 0 0 0 0] (500 -1000 -1000); alpha (500 -1000 -1000);
beta beta [0 -1 0 0 0 0 0] (0 0 0); beta (0 0 0);
rhoRef 1; rhoRef 1;
coordinateSystem coordinateSystem
@ -56,8 +56,8 @@ porosity1
coordinateRotation coordinateRotation
{ {
type axesRotation; type axesRotation;
e1 (0.70710678 0.70710678 0); e1 (0.70710678 0.70710678 0);
e2 (0 0 1); e2 (0 0 1);
} }
} }
} }

View File

@ -46,8 +46,8 @@ porosityBlockage
DarcyForchheimerCoeffs DarcyForchheimerCoeffs
{ {
d d [0 -2 0 0 0] (-1000 -1000 1e4); d (-1000 -1000 1e4);
f f [0 -1 0 0 0] (0 0 0); f (0 0 0);
coordinateSystem coordinateSystem
{ {

View File

@ -23,8 +23,8 @@ porosity1
DarcyForchheimerCoeffs DarcyForchheimerCoeffs
{ {
d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000); d (5e7 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0); f (0 0 0);
coordinateSystem coordinateSystem
{ {

View File

@ -23,8 +23,8 @@ porosity1
DarcyForchheimerCoeffs DarcyForchheimerCoeffs
{ {
d d [0 -2 0 0 0 0 0] (5e7 -1000 -1000); d (5e7 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0); f (0 0 0);
coordinateSystem coordinateSystem
{ {

View File

@ -29,8 +29,8 @@ filter1
DarcyForchheimerCoeffs DarcyForchheimerCoeffs
{ {
d d [0 -2 0 0 0 0 0] (500000 -1000 -1000); d (500000 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0); f (0 0 0);
coordinateSystem coordinateSystem
{ {

View File

@ -29,8 +29,8 @@ porosity1
DarcyForchheimerCoeffs DarcyForchheimerCoeffs
{ {
d d [0 -2 0 0 0 0 0] (2e8 -1000 -1000); d (2e8 -1000 -1000);
f f [0 -1 0 0 0 0 0] (0 0 0); f (0 0 0);
coordinateSystem coordinateSystem
{ {