Skip to content
Snippets Groups Projects
Commit 86cd5400 authored by Andrew Heather's avatar Andrew Heather
Browse files

Merge branch 'bug-GL1732' into 'develop'

BUG: provide setup backward-compat for actuationDiskSourceCoeffs

See merge request !372
parents c7584e1a 0445b00e
Branches
Tags
1 merge request!372BUG: provide setup backward-compat for actuationDiskSourceCoeffs
...@@ -107,15 +107,15 @@ void Foam::fv::actuationDiskSource::setMonitorCells(const dictionary& dict) ...@@ -107,15 +107,15 @@ void Foam::fv::actuationDiskSource::setMonitorCells(const dictionary& dict)
List<point> monitorPoints; List<point> monitorPoints;
if (dict.found("monitorCoeffs")) const dictionary* coeffsDictPtr = dict.findDict("monitorCoeffs");
if (coeffsDictPtr)
{ {
const dictionary subDict(dict.subDict("monitorCoeffs")); coeffsDictPtr->readIfPresent("points", monitorPoints);
subDict.readIfPresent("points", monitorPoints);
} }
else else
{ {
monitorPoints.resize(1); monitorPoints.resize(1);
monitorPoints[0] = dict.get<point>("upstreamPoint"); dict.readEntry("upstreamPoint", monitorPoints.first());
} }
for (const auto& monitorPoint : monitorPoints) for (const auto& monitorPoint : monitorPoints)
...@@ -170,13 +170,13 @@ Foam::fv::actuationDiskSource::actuationDiskSource ...@@ -170,13 +170,13 @@ Foam::fv::actuationDiskSource::actuationDiskSource
) )
: :
cellSetOption(name, modelType, dict, mesh), cellSetOption(name, modelType, dict, mesh),
writeFile(mesh, name, modelType, dict), writeFile(mesh, name, modelType, coeffs_),
forceMethod_ forceMethod_
( (
forceMethodTypeNames.getOrDefault forceMethodTypeNames.getOrDefault
( (
"variant", "variant",
dict, coeffs_,
forceMethodType::FROUDE forceMethodType::FROUDE
) )
), ),
...@@ -185,21 +185,21 @@ Foam::fv::actuationDiskSource::actuationDiskSource ...@@ -185,21 +185,21 @@ Foam::fv::actuationDiskSource::actuationDiskSource
monitorMethodTypeNames.getOrDefault monitorMethodTypeNames.getOrDefault
( (
"monitorMethod", "monitorMethod",
dict, coeffs_,
monitorMethodType::POINTS monitorMethodType::POINTS
) )
), ),
sink_ sink_
( (
dict.getOrDefault<bool>("sink", true) coeffs_.getOrDefault<bool>("sink", true)
? 1 ? 1
: -1 : -1
), ),
writeFileStart_(dict.getOrDefault<scalar>("writeFileStart", 0)), writeFileStart_(coeffs_.getOrDefault<scalar>("writeFileStart", 0)),
writeFileEnd_(dict.getOrDefault<scalar>("writeFileEnd", VGREAT)), writeFileEnd_(coeffs_.getOrDefault<scalar>("writeFileEnd", VGREAT)),
diskArea_ diskArea_
( (
dict.getCheck<scalar> coeffs_.getCheck<scalar>
( (
"diskArea", "diskArea",
scalarMinMax::ge(VSMALL) scalarMinMax::ge(VSMALL)
...@@ -207,18 +207,17 @@ Foam::fv::actuationDiskSource::actuationDiskSource ...@@ -207,18 +207,17 @@ Foam::fv::actuationDiskSource::actuationDiskSource
), ),
diskDir_ diskDir_
( (
dict.getCheck<vector> coeffs_.getCheck<vector>
( (
"diskDir", "diskDir",
[&](const vector& vec){ return mag(vec) > VSMALL; } [&](const vector& vec){ return mag(vec) > VSMALL; }
).normalise() ).normalise()
), ),
UvsCpPtr_(Function1<scalar>::New("Cp", dict)), UvsCpPtr_(Function1<scalar>::New("Cp", coeffs_)),
UvsCtPtr_(Function1<scalar>::New("Ct", dict)), UvsCtPtr_(Function1<scalar>::New("Ct", coeffs_)),
monitorCells_() monitorCells_()
{ {
//setMonitorCells((dict.subDict("monitorCoeffs"))); setMonitorCells(coeffs_);
setMonitorCells(dict);
fieldNames_.setSize(1, "U"); fieldNames_.setSize(1, "U");
......
...@@ -302,7 +302,7 @@ private: ...@@ -302,7 +302,7 @@ private:
// Private Member Functions // Private Member Functions
//- Locate the set of cells whereat the incoming velocity is monitored //- Locate the set of cells whereat the incoming velocity is monitored
void setMonitorCells(const dictionary& subDict); void setMonitorCells(const dictionary& dict);
//- Compute the selected force computation method type //- Compute the selected force computation method type
template<class AlphaFieldType, class RhoFieldType> template<class AlphaFieldType, class RhoFieldType>
......
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