From 73cef20494dc4e7fec53ba79a2ff46a6da5713a0 Mon Sep 17 00:00:00 2001 From: Henry Weller <http://cfd.direct> Date: Wed, 17 Aug 2016 09:37:37 +0100 Subject: [PATCH] viscosityModels: State virtual functions are virtual also in the derived classes --- .../viscosityModels/BirdCarreau/BirdCarreau.H | 12 ++++++------ .../viscosityModels/CrossPowerLaw/CrossPowerLaw.H | 12 ++++++------ .../HerschelBulkley/HerschelBulkley.H | 12 ++++++------ .../viscosityModels/Newtonian/Newtonian.H | 12 ++++++------ .../viscosityModels/powerLaw/powerLaw.H | 12 ++++++------ 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/transportModels/incompressible/viscosityModels/BirdCarreau/BirdCarreau.H b/src/transportModels/incompressible/viscosityModels/BirdCarreau/BirdCarreau.H index a036f10b8f0..1a1db601f75 100644 --- a/src/transportModels/incompressible/viscosityModels/BirdCarreau/BirdCarreau.H +++ b/src/transportModels/incompressible/viscosityModels/BirdCarreau/BirdCarreau.H @@ -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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -95,32 +95,32 @@ public: //- Destructor - ~BirdCarreau() + virtual ~BirdCarreau() {} // Member Functions //- Return the laminar viscosity - tmp<volScalarField> nu() const + virtual tmp<volScalarField> nu() const { return nu_; } //- Return the laminar viscosity for patch - tmp<scalarField> nu(const label patchi) const + virtual tmp<scalarField> nu(const label patchi) const { return nu_.boundaryField()[patchi]; } //- Correct the laminar viscosity - void correct() + virtual void correct() { nu_ = calcNu(); } //- Read transportProperties dictionary - bool read(const dictionary& viscosityProperties); + virtual bool read(const dictionary& viscosityProperties); }; diff --git a/src/transportModels/incompressible/viscosityModels/CrossPowerLaw/CrossPowerLaw.H b/src/transportModels/incompressible/viscosityModels/CrossPowerLaw/CrossPowerLaw.H index 16ad05468db..a0f9ffe6baf 100644 --- a/src/transportModels/incompressible/viscosityModels/CrossPowerLaw/CrossPowerLaw.H +++ b/src/transportModels/incompressible/viscosityModels/CrossPowerLaw/CrossPowerLaw.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -90,32 +90,32 @@ public: //- Destructor - ~CrossPowerLaw() + virtual ~CrossPowerLaw() {} // Member Functions //- Return the laminar viscosity - tmp<volScalarField> nu() const + virtual tmp<volScalarField> nu() const { return nu_; } //- Return the laminar viscosity for patch - tmp<scalarField> nu(const label patchi) const + virtual tmp<scalarField> nu(const label patchi) const { return nu_.boundaryField()[patchi]; } //- Correct the laminar viscosity - void correct() + virtual void correct() { nu_ = calcNu(); } //- Read transportProperties dictionary - bool read(const dictionary& viscosityProperties); + virtual bool read(const dictionary& viscosityProperties); }; diff --git a/src/transportModels/incompressible/viscosityModels/HerschelBulkley/HerschelBulkley.H b/src/transportModels/incompressible/viscosityModels/HerschelBulkley/HerschelBulkley.H index 5e97539f866..df105b5807c 100644 --- a/src/transportModels/incompressible/viscosityModels/HerschelBulkley/HerschelBulkley.H +++ b/src/transportModels/incompressible/viscosityModels/HerschelBulkley/HerschelBulkley.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,32 +91,32 @@ public: //- Destructor - ~HerschelBulkley() + virtual ~HerschelBulkley() {} // Member Functions //- Return the laminar viscosity - tmp<volScalarField> nu() const + virtual tmp<volScalarField> nu() const { return nu_; } //- Return the laminar viscosity for patch - tmp<scalarField> nu(const label patchi) const + virtual tmp<scalarField> nu(const label patchi) const { return nu_.boundaryField()[patchi]; } //- Correct the laminar viscosity - void correct() + virtual void correct() { nu_ = calcNu(); } //- Read transportProperties dictionary - bool read(const dictionary& viscosityProperties); + virtual bool read(const dictionary& viscosityProperties); }; diff --git a/src/transportModels/incompressible/viscosityModels/Newtonian/Newtonian.H b/src/transportModels/incompressible/viscosityModels/Newtonian/Newtonian.H index d4758756da5..481bbf945ec 100644 --- a/src/transportModels/incompressible/viscosityModels/Newtonian/Newtonian.H +++ b/src/transportModels/incompressible/viscosityModels/Newtonian/Newtonian.H @@ -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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,30 +80,30 @@ public: //- Destructor - ~Newtonian() + virtual ~Newtonian() {} // Member Functions //- Return the laminar viscosity - tmp<volScalarField> nu() const + virtual tmp<volScalarField> nu() const { return nu_; } //- Return the laminar viscosity for patch - tmp<scalarField> nu(const label patchi) const + virtual tmp<scalarField> nu(const label patchi) const { return nu_.boundaryField()[patchi]; } //- Correct the laminar viscosity (not appropriate, viscosity constant) - void correct() + virtual void correct() {} //- Read transportProperties dictionary - bool read(const dictionary& viscosityProperties); + virtual bool read(const dictionary& viscosityProperties); }; diff --git a/src/transportModels/incompressible/viscosityModels/powerLaw/powerLaw.H b/src/transportModels/incompressible/viscosityModels/powerLaw/powerLaw.H index eb02c180056..e355a319d85 100644 --- a/src/transportModels/incompressible/viscosityModels/powerLaw/powerLaw.H +++ b/src/transportModels/incompressible/viscosityModels/powerLaw/powerLaw.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,32 +91,32 @@ public: //- Destructor - ~powerLaw() + virtual ~powerLaw() {} // Member Functions //- Return the laminar viscosity - tmp<volScalarField> nu() const + virtual tmp<volScalarField> nu() const { return nu_; } //- Return the laminar viscosity for patch - tmp<scalarField> nu(const label patchi) const + virtual tmp<scalarField> nu(const label patchi) const { return nu_.boundaryField()[patchi]; } //- Correct the laminar viscosity - void correct() + virtual void correct() { nu_ = calcNu(); } //- Read transportProperties dictionary - bool read(const dictionary& viscosityProperties); + virtual bool read(const dictionary& viscosityProperties); }; -- GitLab