From 3f567c2c999fe1b170e7b343f76f5a0631b2c69b Mon Sep 17 00:00:00 2001 From: mattijs <mattijs> Date: Mon, 14 Dec 2015 15:00:31 +0000 Subject: [PATCH] BUG velocityDamping: correct for new framework Fixes #27. --- .../velocityDampingConstraint.C | 14 ++++---------- .../velocityDampingConstraint.H | 15 ++++----------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/fvOptions/constraints/derived/velocityDampingConstraint/velocityDampingConstraint.C b/src/fvOptions/constraints/derived/velocityDampingConstraint/velocityDampingConstraint.C index 57b78fe95a9..dd2280f610d 100644 --- a/src/fvOptions/constraints/derived/velocityDampingConstraint/velocityDampingConstraint.C +++ b/src/fvOptions/constraints/derived/velocityDampingConstraint/velocityDampingConstraint.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -93,7 +93,7 @@ Foam::fv::velocityDampingConstraint::velocityDampingConstraint const fvMesh& mesh ) : - option(name, modelType, dict, mesh) + cellSetOption(name, modelType, dict, mesh) { read(dict); } @@ -101,13 +101,7 @@ Foam::fv::velocityDampingConstraint::velocityDampingConstraint // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::fv::velocityDampingConstraint::alwaysApply() const -{ - return true; -} - - -void Foam::fv::velocityDampingConstraint::setValue +void Foam::fv::velocityDampingConstraint::constrain ( fvMatrix<vector>& eqn, const label fieldI @@ -126,7 +120,7 @@ void Foam::fv::velocityDampingConstraint::writeData(Ostream& os) const bool Foam::fv::velocityDampingConstraint::read(const dictionary& dict) { - if (option::read(dict)) + if (cellSetOption::read(dict)) { UMax_ = readScalar(coeffs_.lookup("UMax")); diff --git a/src/fvOptions/constraints/derived/velocityDampingConstraint/velocityDampingConstraint.H b/src/fvOptions/constraints/derived/velocityDampingConstraint/velocityDampingConstraint.H index c5a11aa45d1..1b78c293302 100644 --- a/src/fvOptions/constraints/derived/velocityDampingConstraint/velocityDampingConstraint.H +++ b/src/fvOptions/constraints/derived/velocityDampingConstraint/velocityDampingConstraint.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -55,7 +55,7 @@ SourceFiles #ifndef velocityDampingConstraint_H #define velocityDampingConstraint_H -#include "fvOption.H" +#include "cellSetOption.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -70,7 +70,7 @@ namespace fv class velocityDampingConstraint : - public option + public cellSetOption { protected: @@ -122,17 +122,10 @@ public: // Member Functions - virtual bool alwaysApply() const; - - // Set values directly //- Constrain vector matrix - virtual void setValue - ( - fvMatrix<vector>& eqn, - const label fieldI - ); + virtual void constrain(fvMatrix<vector>& eqn, const label fieldI); // I-O -- GitLab