ENH: Coded fvOption - updated construction of the redirectFvOption to simplify user input

This commit is contained in:
Andrew Heather
2016-10-19 11:52:00 +01:00
parent 39c1722ec3
commit b8bb55507e
3 changed files with 7 additions and 11 deletions

View File

@ -3,7 +3,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-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -134,6 +134,7 @@ Foam::fv::option& Foam::fv::CodedSource<Type>::redirectFvOption() const
{ {
dictionary constructDict(dict_); dictionary constructDict(dict_);
constructDict.set("type", name_); constructDict.set("type", name_);
constructDict.changeKeyword(modelType_ & "Coeffs", name_ & "Coeffs");
redirectFvOptionPtr_ = option::New redirectFvOptionPtr_ = option::New
( (

View File

@ -28,7 +28,7 @@ Group
grpFvOptionsSources grpFvOptionsSources
Description Description
Constructs on-the-fly fvOption source Constructs on-the-fly fvOption source
The hook functions take the following arguments: The hook functions take the following arguments:
@ -50,7 +50,7 @@ Description
) )
where : where :
field is the field in fieldNames field is the name of the field in the fields list
eqn is the fvMatrix eqn is the fvMatrix
Usage Usage
@ -99,11 +99,6 @@ Usage
$codeSetValue $codeSetValue
#}; #};
} }
sourceTimeCoeffs
{
// Dummy entry
}
} }
\endverbatim \endverbatim

View File

@ -37,13 +37,13 @@ bool Foam::fv::CodedSource<Type>::read(const dictionary& dict)
applied_.setSize(fieldNames_.size(), false); applied_.setSize(fieldNames_.size(), false);
// Backward compatibility // Backward compatibility
if (dict.found("redirectType")) if (coeffs_.found("redirectType"))
{ {
dict.lookup("redirectType") >> name_; coeffs_.lookup("redirectType") >> name_;
} }
else else
{ {
dict.lookup("name") >> name_; coeffs_.lookup("name") >> name_;
} }
// Code snippets // Code snippets