mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
porosityModel: The "<porosityModel>Coeffs" sub-dictionary is now optional
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.
This commit is contained in:
@ -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-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -97,7 +97,12 @@ Foam::porosityModel::porosityModel
|
|||||||
name_(name),
|
name_(name),
|
||||||
mesh_(mesh),
|
mesh_(mesh),
|
||||||
dict_(dict),
|
dict_(dict),
|
||||||
coeffs_(dict.subDict(modelType + "Coeffs")),
|
coeffs_
|
||||||
|
(
|
||||||
|
dict.found(modelType + "Coeffs")
|
||||||
|
? dict.subDict(modelType + "Coeffs")
|
||||||
|
: dict
|
||||||
|
),
|
||||||
active_(true),
|
active_(true),
|
||||||
zoneName_(cellZoneName),
|
zoneName_(cellZoneName),
|
||||||
cellZoneIDs_(),
|
cellZoneIDs_(),
|
||||||
@ -105,7 +110,7 @@ Foam::porosityModel::porosityModel
|
|||||||
{
|
{
|
||||||
if (zoneName_ == word::null)
|
if (zoneName_ == word::null)
|
||||||
{
|
{
|
||||||
dict.lookup("active") >> active_;
|
dict.readIfPresent("active", active_);
|
||||||
dict_.lookup("cellZone") >> zoneName_;
|
dict_.lookup("cellZone") >> zoneName_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,8 +232,17 @@ bool Foam::porosityModel::writeData(Ostream& os) const
|
|||||||
|
|
||||||
bool Foam::porosityModel::read(const dictionary& dict)
|
bool Foam::porosityModel::read(const dictionary& dict)
|
||||||
{
|
{
|
||||||
active_ = readBool(dict.lookup("active"));
|
dict.readIfPresent("active", active_);
|
||||||
coeffs_ = dict.subDict(type() + "Coeffs");
|
|
||||||
|
if (dict.found(type() + "Coeffs"))
|
||||||
|
{
|
||||||
|
coeffs_ = dict.subDict(type() + "Coeffs");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
coeffs_ = dict;
|
||||||
|
}
|
||||||
|
|
||||||
dict.lookup("cellZone") >> zoneName_;
|
dict.lookup("cellZone") >> zoneName_;
|
||||||
cellZoneIDs_ = mesh_.cellZones().findIndices(zoneName_);
|
cellZoneIDs_ = mesh_.cellZones().findIndices(zoneName_);
|
||||||
|
|
||||||
|
|||||||
@ -18,24 +18,21 @@ FoamFile
|
|||||||
porosity1
|
porosity1
|
||||||
{
|
{
|
||||||
type DarcyForchheimer;
|
type DarcyForchheimer;
|
||||||
active yes;
|
|
||||||
cellZone porosity;
|
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;
|
type axesRotation;
|
||||||
origin (0 0 0);
|
e1 (0.70710678 0.70710678 0);
|
||||||
coordinateRotation
|
e2 (0 0 1);
|
||||||
{
|
|
||||||
type axesRotation;
|
|
||||||
e1 (0.70710678 0.70710678 0);
|
|
||||||
e2 (0 0 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,24 +18,21 @@ FoamFile
|
|||||||
porosity1
|
porosity1
|
||||||
{
|
{
|
||||||
type DarcyForchheimer;
|
type DarcyForchheimer;
|
||||||
active yes;
|
|
||||||
cellZone porosity;
|
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;
|
type axesRotation;
|
||||||
origin (0 0 0);
|
e1 (0.70710678 0.70710678 0);
|
||||||
coordinateRotation
|
e2 (0 0 1);
|
||||||
{
|
|
||||||
type axesRotation;
|
|
||||||
e1 (0.70710678 0.70710678 0);
|
|
||||||
e2 (0 0 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,24 +18,21 @@ FoamFile
|
|||||||
porosity1
|
porosity1
|
||||||
{
|
{
|
||||||
type DarcyForchheimer;
|
type DarcyForchheimer;
|
||||||
active yes;
|
|
||||||
cellZone porosity;
|
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;
|
type axesRotation;
|
||||||
origin (0 0 0);
|
e1 (1 0 0); //(0.70710678 0.70710678 0);
|
||||||
coordinateRotation
|
e2 (0 0 1);
|
||||||
{
|
|
||||||
type axesRotation;
|
|
||||||
e1 (1 0 0); //(0.70710678 0.70710678 0);
|
|
||||||
e2 (0 0 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user