Skip to content

Commit

Permalink
porosityModel: The "<porosityModel>Coeffs" sub-dictionary is now opti…
Browse files Browse the repository at this point in the history
…onal

For example the porosity coefficients may now be specified thus:

porosity1
{
    type            DarcyForchheimer;

    cellZone        porosity;

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

    coordinateSystem
    {
        type    cartesian;
        origin  (0 0 0);
        coordinateRotation
        {
            type    axesRotation;
            e1      (0.70710678 0.70710678 0);
            e2      (0 0 1);
        }
    }
}

rather than

porosity1
{
    type            DarcyForchheimer;
    active          yes;
    cellZone        porosity;

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

        coordinateSystem
        {
            type    cartesian;
            origin  (0 0 0);
            coordinateRotation
            {
                type    axesRotation;
                e1      (0.70710678 0.70710678 0);
                e2      (0 0 1);
            }
        }
    }
}

support for which is maintained for backward compatibility.
  • Loading branch information
Henry Weller committed Apr 13, 2017
1 parent 9ece58a commit 045014d
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
Expand Down Expand Up @@ -97,15 +97,20 @@ Foam::porosityModel::porosityModel
name_(name),
mesh_(mesh),
dict_(dict),
coeffs_(dict.subDict(modelType + "Coeffs")),
coeffs_
(
dict.found(modelType + "Coeffs")
? dict.subDict(modelType + "Coeffs")
: dict
),
active_(true),
zoneName_(cellZoneName),
cellZoneIDs_(),
coordSys_(coordinateSystem::New(mesh, coeffs_))
{
if (zoneName_ == word::null)
{
dict.lookup("active") >> active_;
dict.readIfPresent("active", active_);
dict_.lookup("cellZone") >> zoneName_;
}

Expand Down Expand Up @@ -227,8 +232,17 @@ bool Foam::porosityModel::writeData(Ostream& os) const

bool Foam::porosityModel::read(const dictionary& dict)
{
active_ = readBool(dict.lookup("active"));
coeffs_ = dict.subDict(type() + "Coeffs");
dict.readIfPresent("active", active_);

if (dict.found(type() + "Coeffs"))
{
coeffs_ = dict.subDict(type() + "Coeffs");
}
else
{
coeffs_ = dict;
}

dict.lookup("cellZone") >> zoneName_;
cellZoneIDs_ = mesh_.cellZones().findIndices(zoneName_);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,21 @@ FoamFile
porosity1
{
type DarcyForchheimer;
active yes;

cellZone porosity;

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

coordinateSystem
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (0.70710678 0.70710678 0);
e2 (0 0 1);
}
type axesRotation;
e1 (0.70710678 0.70710678 0);
e2 (0 0 1);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,21 @@ FoamFile
porosity1
{
type DarcyForchheimer;
active yes;

cellZone porosity;

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

coordinateSystem
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (0.70710678 0.70710678 0);
e2 (0 0 1);
}
type axesRotation;
e1 (0.70710678 0.70710678 0);
e2 (0 0 1);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,21 @@ FoamFile
porosity1
{
type DarcyForchheimer;
active yes;

cellZone porosity;

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

coordinateSystem
coordinateSystem
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 0 0); //(0.70710678 0.70710678 0);
e2 (0 0 1);
}
type axesRotation;
e1 (1 0 0); //(0.70710678 0.70710678 0);
e2 (0 0 1);
}
}
}
Expand Down

0 comments on commit 045014d

Please sign in to comment.