fvOptions: The "<type>Coeffs" sub-dictionary is now optional

For example the actuationDiskSource fvOption may now be specified

disk1
{
    type            actuationDiskSource;

    fields      (U);

    selectionMode   cellSet;
    cellSet         actuationDisk1;
    diskDir         (1 0 0);    // Orientation of the disk
    Cp              0.386;
    Ct              0.58;
    diskArea        40;
    upstreamPoint   (581849 4785810 1065);
}

rather than

disk1
{
    type            actuationDiskSource;
    active          on;

    actuationDiskSourceCoeffs
    {
        fields      (U);

        selectionMode   cellSet;
        cellSet         actuationDisk1;
        diskDir         (1 0 0);    // Orientation of the disk
        Cp              0.386;
        Ct              0.58;
        diskArea        40;
        upstreamPoint   (581849 4785810 1065);
    }
}

but this form is supported for backward compatibility.
This commit is contained in:
Henry Weller 2017-04-13 13:30:17 +01:00
parent e9ba8242ca
commit 8b55ea4fb1
39 changed files with 383 additions and 529 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -52,7 +52,12 @@ Foam::fv::option::option
modelType_(modelType),
mesh_(mesh),
dict_(dict),
coeffs_(dict.subDict(modelType + "Coeffs")),
coeffs_
(
dict.found(modelType + "Coeffs")
? dict.subDict(modelType + "Coeffs")
: dict
),
active_(dict_.lookupOrDefault<Switch>("active", true)),
fieldNames_(),
applied_()
@ -75,6 +80,13 @@ Foam::autoPtr<Foam::fv::option> Foam::fv::option::New
Info<< indent
<< "Selecting finite volume options model type " << modelType << endl;
const_cast<Time&>(mesh.time()).libs().open
(
coeffs,
"libs",
dictionaryConstructorTablePtr_
);
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -53,7 +53,15 @@ void Foam::fv::option::writeData(Ostream& os) const
bool Foam::fv::option::read(const dictionary& dict)
{
dict.readIfPresent("active", active_);
if (dict.found(modelType_ + "Coeffs"))
{
coeffs_ = dict.subDict(modelType_ + "Coeffs");
}
else
{
coeffs_ = dict;
}
return true;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,15 +31,12 @@ Description
type scalarExplicitSource // Source type
active on; // on/off switch
scalarExplicitSourceCoeffs
{
timeStart 0.0; // Start time
duration 1000.0; // Duration
selectionMode cellSet; // cellSet, points, cellZone
.
.
.
}
\endverbatim
Note

View File

@ -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
@ -34,8 +34,6 @@ Usage
type fixedTemperatureConstraint;
active yes;
fixedTemperatureConstraintCoeffs
{
mode uniform; // uniform or lookup
// For uniform option
@ -44,7 +42,6 @@ Usage
// For lookup option
// T <Tname>; // optional temperature field name
}
}
\endverbatim
Note:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,8 +35,6 @@ Usage
type scalarFixedValueConstraint;
active yes;
scalarFixedValueConstraintCoeffs
{
selectionMode cellZone;
cellZone porosity;
fieldValues
@ -45,7 +43,6 @@ Usage
epsilon 150;
}
}
}
\endverbatim
See also

View File

@ -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
@ -36,13 +36,10 @@ Usage
type limitTemperature;
active yes;
limitTemperatureCoeffs
{
selectionMode all;
min 200;
max 500;
}
}
\endverbatim
SourceFiles

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,12 +35,9 @@ Usage
type limitVelocity;
active yes;
limitVelocityCoeffs
{
selectionMode all;
max 100;
}
}
\endverbatim
SourceFiles

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -47,15 +47,12 @@ Description
Usage
Example usage:
\verbatim
actuationDiskSourceCoeffs
{
fields (U); // names of fields to apply source
diskDir (-1 0 0); // disk direction
Cp 0.1; // power coefficient
Ct 0.5; // thrust coefficient
diskArea 5.0; // disk area
upstreamPoint (0 0 0); // upstream point
}
\endverbatim

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,10 +31,7 @@ Description
Usage
Example usage:
\verbatim
buoyancyEnergyCoeffs
{
fields (h); // Name of energy field
}
\endverbatim
SourceFiles

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,10 +31,7 @@ Description
Usage
Example usage:
\verbatim
buoyancyForceCoeffs
{
fields (U); // Name of velocity field
}
\endverbatim
SourceFiles

View File

@ -67,8 +67,6 @@ Usage
type effectivenessHeatExchangerSource;
active yes;
effectivenessHeatExchangerSourceCoeffs
{
selectionMode cellZone;
cellZone porosity;
@ -79,7 +77,6 @@ Usage
outOfBounds clamp;
fileName "effTable";
}
}
\endverbatim
The effectiveness table is described in terms of the primary and secondary

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,13 +33,10 @@ Description
Usage
Example usage:
\verbatim
meanVelocityForceCoeffs
{
selectionMode all; // Apply force to all cells
fields (U); // Name of velocity field
Ubar (10.0 0 0); // Desired mean velocity
relaxation 0.2; // Optional relaxation factor
}
\endverbatim
SourceFiles

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,14 +33,11 @@ Description
Usage
Example usage:
\verbatim
patchMeanVelocityForceCoeffs
{
selectionMode all; // Apply force to all cells
fields (U); // Name of velocity field
patch inlet; // Name of the patch
Ubar (10.0 0 0); // Desired mean velocity
relaxation 0.2; // Optional relaxation factor
}
\endverbatim
SourceFiles

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -53,8 +53,6 @@ Description
Usage
Example usage:
\verbatim
actuationDiskSourceCoeffs
{
fieldName U; // name of field to apply source
diskDir (-1 0 0); // disk direction
Cp 0.1; // power coefficient
@ -62,7 +60,6 @@ Usage
diskArea 5.0; // disk area
coeffs (0.1 0.5 0.01); // radial distribution coefficients
upstreamPoint (0 0 0); // upstream point
}
\endverbatim

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,8 +33,6 @@ Description
Usage
Example usage:
\verbatim
rotorDiskSourceCoeffs
{
fields (U); // names of fields on which to apply source
nBlades 3; // number of blades
tipEffect 0.96; // normalised radius above which lift = 0
@ -73,7 +71,6 @@ Usage
...
}
}
}
\endverbatim
Where:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -243,7 +243,7 @@ Foam::fv::solidificationMeltingSource::solidificationMeltingSource
}
}
applied_.setSize(2, false);
applied_.setSize(fieldNames_.size(), false);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -53,8 +53,6 @@ Usage
type solidificationMeltingSource;
active yes;
solidificationMeltingSourceCoeffs
{
selectionMode cellZone;
cellZone iceZone;
@ -64,7 +62,6 @@ Usage
beta 50e-6;
rhoRef 800;
}
}
\endverbatim
Where:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,11 +35,8 @@ Usage
type tabulatedAccelerationSource;
active yes;
tabulatedAccelerationSourceCoeffs
{
timeDataFileName "constant/acceleration-terms.dat";
}
}
\endverbatim
SourceFiles

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -42,15 +42,12 @@ Description
Example of the source specification:
\verbatim
<Type>SemiImplicitSourceCoeffs
{
volumeMode absolute; // specific
injectionRateSuSp
{
k (30.7 0);
epsilon (1.5 0);
}
}
\endverbatim
Valid options for the \c volumeMode entry include:

View File

@ -18,7 +18,6 @@ FoamFile
porosity1
{
type explicitPorositySource;
active yes;
explicitPorositySourceCoeffs
{
@ -27,8 +26,6 @@ porosity1
type DarcyForchheimer;
DarcyForchheimerCoeffs
{
d (7e5 -1000 -1000);
f (0 0 0);
@ -45,7 +42,6 @@ porosity1
}
}
}
}
//************************************************************************ //

View File

@ -18,7 +18,6 @@ FoamFile
porosity1
{
type explicitPorositySource;
active yes;
explicitPorositySourceCoeffs
{
@ -27,8 +26,6 @@ porosity1
type DarcyForchheimer;
DarcyForchheimerCoeffs
{
d (5e7 -1000 -1000);
f (0 0 0);
@ -45,7 +42,6 @@ porosity1
}
}
}
}
// ************************************************************************* //

View File

@ -18,7 +18,6 @@ FoamFile
porosity1
{
type explicitPorositySource;
active yes;
explicitPorositySourceCoeffs
{
@ -27,8 +26,6 @@ porosity1
type DarcyForchheimer;
DarcyForchheimerCoeffs
{
d (1e5 -1000 -1000);
f (0 0 0);
@ -45,7 +42,6 @@ porosity1
}
}
}
}
// ************************************************************************* //

View File

@ -18,17 +18,13 @@ FoamFile
source1
{
type fixedTemperatureConstraint;
active yes;
fixedTemperatureConstraintCoeffs
{
selectionMode cellZone;
cellZone porosity;
mode uniform;
temperature 350;
}
}
// ************************************************************************* //

View File

@ -18,7 +18,6 @@ FoamFile
porosity
{
type explicitPorositySource;
active yes;
explicitPorositySourceCoeffs
{
@ -53,25 +52,18 @@ porosity
fixedTemperature
{
type fixedTemperatureConstraint;
active yes;
fixedTemperatureConstraintCoeffs
{
selectionMode cellZone;
cellZone porosity;
mode uniform;
temperature 350;
}
}
porosityTurbulence
{
type scalarFixedValueConstraint;
active yes;
scalarFixedValueConstraintCoeffs
{
selectionMode cellZone;
cellZone porosity;
fieldValues
@ -80,7 +72,6 @@ porosityTurbulence
epsilon 150;
}
}
}
// ************************************************************************* //

View File

@ -18,10 +18,7 @@ FoamFile
airToporous
{
type constantHeatTransfer;
active yes;
constantHeatTransferCoeffs
{
interpolationMethod cellVolumeWeight;
nbrRegionName porous;
master false;
@ -30,12 +27,10 @@ airToporous
fields (h);
semiImplicit no;
}
}
porosityBlockage
{
type interRegionExplicitPorositySource;
active yes;
interRegionExplicitPorositySourceCoeffs
{
@ -44,8 +39,6 @@ porosityBlockage
type DarcyForchheimer;
DarcyForchheimerCoeffs
{
d (-1000 -1000 1e4);
f (0 0 0);
@ -62,7 +55,6 @@ porosityBlockage
}
}
}
}
// ************************************************************************* //

View File

@ -18,10 +18,7 @@ FoamFile
porousToair
{
type constantHeatTransfer;
active yes;
constantHeatTransferCoeffs
{
interpolationMethod cellVolumeWeight;
nbrRegionName air;
master true;
@ -30,7 +27,6 @@ porousToair
fields (h);
semiImplicit no;
}
}
// ************************************************************************* //

View File

@ -18,16 +18,12 @@ FoamFile
momentumSource
{
type meanVelocityForce;
active yes;
meanVelocityForceCoeffs
{
selectionMode all;
fields (U);
Ubar (0.1335 0 0);
}
}
// ************************************************************************* //

View File

@ -18,10 +18,7 @@ FoamFile
momentumSource
{
type vectorSemiImplicitSource;
active yes;
vectorSemiImplicitSourceCoeffs
{
timeStart 0.0;
duration 1000;
selectionMode all;
@ -32,7 +29,6 @@ momentumSource
U ((5 0 0) 0);
}
}
}
// ************************************************************************* //

View File

@ -50,13 +50,7 @@ IOdictionary fvOptions
)
);
const dictionary& gradPDict =
fvOptions.subDict("momentumSource").subDict
(
"vectorSemiImplicitSourceCoeffs"
).subDict
(
"injectionRateSuSp"
);
fvOptions.subDict("momentumSource").subDict("injectionRateSuSp");
const scalar K =
Tuple2<vector, scalar>(gradPDict.lookup("U")).first().x();

View File

@ -18,7 +18,6 @@ FoamFile
porosity1
{
type explicitPorositySource;
active yes;
explicitPorositySourceCoeffs
{
@ -32,8 +31,6 @@ porosity1
// D 500; // Slight waviness in the far wake
D 1000; // Fully shedding behavior
DarcyForchheimerCoeffs
{
d ($D $D $D);
f (0 0 0);
@ -50,7 +47,6 @@ porosity1
}
}
}
}
// ************************************************************************* //

View File

@ -17,10 +17,7 @@ FoamFile
disk
{
type rotorDisk;
active on;
rotorDiskCoeffs
{
selectionMode cellZone;
cellZone rotatingZone;
@ -101,6 +98,5 @@ disk
}
}
}
}
// ************************************************************************* //

View File

@ -18,10 +18,7 @@ FoamFile
disk1
{
type actuationDiskSource;
active on;
actuationDiskSourceCoeffs
{
fields (U);
selectionMode cellSet;
@ -32,15 +29,11 @@ disk1
diskArea 40;
upstreamPoint (581849 4785810 1065);
}
}
disk2
{
type actuationDiskSource;
active on;
actuationDiskSourceCoeffs
{
fields (U);
selectionMode cellSet;
@ -51,7 +44,6 @@ disk2
diskArea 40;
upstreamPoint (581753 4785663 1070);
}
}
// ************************************************************************* //

View File

@ -18,10 +18,7 @@ FoamFile
source1
{
type fixedTemperatureConstraint;
active yes;
fixedTemperatureConstraintCoeffs
{
timeStart 0.1;
duration 0.4;
selectionMode cellSet;
@ -30,7 +27,6 @@ source1
mode uniform;
temperature 2000;
}
}
// ************************************************************************* //

View File

@ -18,7 +18,6 @@ FoamFile
filter1
{
type explicitPorositySource;
active yes;
explicitPorositySourceCoeffs
{
@ -27,8 +26,6 @@ filter1
type DarcyForchheimer;
DarcyForchheimerCoeffs
{
d (500000 -1000 -1000);
f (0 0 0);
@ -45,16 +42,12 @@ filter1
}
}
}
}
massSource1
{
type scalarSemiImplicitSource;
active yes;
scalarSemiImplicitSourceCoeffs
{
timeStart 0.2;
duration 2.0;
selectionMode points;
@ -70,16 +63,12 @@ massSource1
H2O (1e-4 0); // kg/s
}
}
}
momentumSource1
{
type vectorSemiImplicitSource;
active yes;
vectorSemiImplicitSourceCoeffs
{
timeStart 0.2;
duration 2.0;
selectionMode points;
@ -94,16 +83,12 @@ momentumSource1
U ((0 0.005 0) 0);
}
}
}
energySource1
{
type scalarSemiImplicitSource;
active yes;
scalarSemiImplicitSourceCoeffs
{
timeStart 0.2;
duration 2.0;
selectionMode points;
@ -118,7 +103,6 @@ energySource1
h (10 0);
}
}
}
// ************************************************************************* //

View File

@ -18,7 +18,6 @@ FoamFile
porosity1
{
type explicitPorositySource;
active yes;
explicitPorositySourceCoeffs
{
@ -27,8 +26,6 @@ porosity1
type DarcyForchheimer;
DarcyForchheimerCoeffs
{
d (2e8 -1000 -1000);
f (0 0 0);
@ -45,7 +42,6 @@ porosity1
}
}
}
}
//************************************************************************* //

View File

@ -32,8 +32,6 @@ options
{
type scalarSemiImplicitSource;
scalarSemiImplicitSourceCoeffs
{
$injector1;
volumeMode absolute;
@ -42,14 +40,11 @@ options
thermo:rho.air (1e-3 0); // kg/s
}
}
}
momentumSource1
{
type vectorSemiImplicitSource;
vectorSemiImplicitSourceCoeffs
{
$injector1;
volumeMode absolute;
@ -58,14 +53,11 @@ options
U.air ((0 -1e-2 0) 0); // kg*m/s^2
}
}
}
energySource1
{
type scalarSemiImplicitSource;
scalarSemiImplicitSourceCoeffs
{
$injector1;
volumeMode absolute;
@ -75,7 +67,6 @@ options
}
}
}
}
// ************************************************************************* //

View File

@ -32,8 +32,6 @@ options
{
type scalarSemiImplicitSource;
scalarSemiImplicitSourceCoeffs
{
$injector1;
volumeMode absolute;
@ -42,14 +40,11 @@ options
thermo:rho.steam (1.0e-3 0); // kg/s
}
}
}
momentumSource1
{
type vectorSemiImplicitSource;
vectorSemiImplicitSourceCoeffs
{
$injector1;
volumeMode absolute;
@ -58,14 +53,11 @@ options
U.steam ((0 1e-1 0) 0); // kg*m/s^2
}
}
}
energySource1
{
type scalarSemiImplicitSource;
scalarSemiImplicitSourceCoeffs
{
$injector1;
volumeMode absolute;
@ -75,7 +67,6 @@ options
}
}
}
}
// ************************************************************************* //

View File

@ -32,8 +32,6 @@ options
{
type scalarSemiImplicitSource;
scalarSemiImplicitSourceCoeffs
{
$injector1;
volumeMode absolute;
@ -42,14 +40,11 @@ options
thermo:rho.air (1e-3 0); // kg/s
}
}
}
momentumSource1
{
type vectorSemiImplicitSource;
vectorSemiImplicitSourceCoeffs
{
$injector1;
volumeMode absolute;
@ -58,14 +53,11 @@ options
U.air ((0 -1e-2 0) 0); // kg*m/s^2
}
}
}
energySource1
{
type scalarSemiImplicitSource;
scalarSemiImplicitSourceCoeffs
{
$injector1;
volumeMode absolute;
@ -75,7 +67,6 @@ options
}
}
}
}
// ************************************************************************* //