diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/Make/files b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/Make/files index 40a3d6c02c4299dc4d5ff1aa0629627f78e44cb2..4658a4989666419d0bef4d87b89acae0ab539a3b 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/Make/files +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/Make/files @@ -66,5 +66,7 @@ wallDampingModels/wallDampingModel/wallDampingModel.C wallDampingModels/wallDampingModel/newWallDampingModel.C wallDampingModels/noWallDamping/noWallDamping.C wallDampingModels/linear/linearWallDamping.C +wallDampingModels/cosine/cosineWallDamping.C +wallDampingModels/sine/sineWallDamping.C LIB = $(FOAM_LIBBIN)/libreactingEulerianInterfacialModels diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.C new file mode 100644 index 0000000000000000000000000000000000000000..241ad545294be1258a15f78e7126dc0674b9a5b3 --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.C @@ -0,0 +1,119 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "cosineWallDamping.H" +#include "phasePair.H" +#include "surfaceInterpolate.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallDampingModels +{ + defineTypeNameAndDebug(cosine, 0); + addToRunTimeSelectionTable + ( + wallDampingModel, + cosine, + dictionary + ); +} +} + + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> +Foam::wallDampingModels::cosine::limiter() const +{ + return + ( + 0.5* + ( + 1 + - cos + ( + constant::mathematical::pi + *min(yWall()/(Cd_*pair_.dispersed().d()), scalar(1)) + ) + ) + ); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallDampingModels::cosine::cosine +( + const dictionary& dict, + const phasePair& pair +) +: + wallDampingModel(dict, pair), + Cd_("Cd", dimless, dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallDampingModels::cosine::~cosine() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> +Foam::wallDampingModels::cosine::damp +( + const tmp<volScalarField>& F +) const +{ + return limiter()*F; +} + + +Foam::tmp<Foam::volVectorField> +Foam::wallDampingModels::cosine::damp +( + const tmp<volVectorField>& F +) const +{ + return limiter()*F; +} + + +Foam::tmp<Foam::surfaceScalarField> +Foam::wallDampingModels::cosine::damp +( + const tmp<surfaceScalarField>& Ff +) const +{ + return fvc::interpolate(limiter())*Ff; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.H new file mode 100644 index 0000000000000000000000000000000000000000..5c48fe32dd1c83acd771e6f57e1fabb6a76eda9c --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/cosine/cosineWallDamping.H @@ -0,0 +1,120 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::wallDampingModels::cosine + +Description + +SourceFiles + cosineWallDamping.C + +\*---------------------------------------------------------------------------*/ + +#ifndef cosineWallDamping_H +#define cosineWallDamping_H + +#include "wallDampingModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace wallDampingModels +{ + +/*---------------------------------------------------------------------------*\ + Class cosine Declaration +\*---------------------------------------------------------------------------*/ + +class cosine +: + public wallDampingModel +{ + // Private data + + //- Diameter coefficient + const dimensionedScalar Cd_; + + + // Private member functions + + //- Return the force limiter field + tmp<volScalarField> limiter() const; + + +public: + + //- Runtime type information + TypeName("cosine"); + + + // Constructors + + //- Construct from components + cosine + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~cosine(); + + + // Member Functions + + //- Return damped coefficient + virtual tmp<volScalarField> damp + ( + const tmp<volScalarField>& + ) const; + + //- Return damped force + virtual tmp<volVectorField> damp + ( + const tmp<volVectorField>& + ) const; + + //- Return damped face force + virtual tmp<surfaceScalarField> damp + ( + const tmp<surfaceScalarField>& + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace wallDampingModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.C index fdae491d608675aa7da65a2e1b8150dea240c6ea..9004cda36527d61b064c53db8cf0b4ddbe68855c 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/linear/linearWallDamping.C @@ -50,7 +50,7 @@ namespace wallDampingModels Foam::tmp<Foam::volScalarField> Foam::wallDampingModels::linear::limiter() const { - return min(yWall()/(Cd_*pair_.dispersed().d()), 1.0); + return min(yWall()/(Cd_*pair_.dispersed().d()), scalar(1)); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.C new file mode 100644 index 0000000000000000000000000000000000000000..d287f9175c58bdb017e4e42b2e378c9055654000 --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.C @@ -0,0 +1,112 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "sineWallDamping.H" +#include "phasePair.H" +#include "surfaceInterpolate.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallDampingModels +{ + defineTypeNameAndDebug(sine, 0); + addToRunTimeSelectionTable + ( + wallDampingModel, + sine, + dictionary + ); +} +} + + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> +Foam::wallDampingModels::sine::limiter() const +{ + return sin + ( + constant::mathematical::piByTwo + *min(yWall()/(Cd_*pair_.dispersed().d()), scalar(1)) + ); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallDampingModels::sine::sine +( + const dictionary& dict, + const phasePair& pair +) +: + wallDampingModel(dict, pair), + Cd_("Cd", dimless, dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallDampingModels::sine::~sine() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> +Foam::wallDampingModels::sine::damp +( + const tmp<volScalarField>& F +) const +{ + return limiter()*F; +} + + +Foam::tmp<Foam::volVectorField> +Foam::wallDampingModels::sine::damp +( + const tmp<volVectorField>& F +) const +{ + return limiter()*F; +} + + +Foam::tmp<Foam::surfaceScalarField> +Foam::wallDampingModels::sine::damp +( + const tmp<surfaceScalarField>& Ff +) const +{ + return fvc::interpolate(limiter())*Ff; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.H b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.H new file mode 100644 index 0000000000000000000000000000000000000000..1bd50feb5f2559b833c57da3b1375606b6fc6855 --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/wallDampingModels/sine/sineWallDamping.H @@ -0,0 +1,120 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::wallDampingModels::sine + +Description + +SourceFiles + sineWallDamping.C + +\*---------------------------------------------------------------------------*/ + +#ifndef sineWallDamping_H +#define sineWallDamping_H + +#include "wallDampingModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace wallDampingModels +{ + +/*---------------------------------------------------------------------------*\ + Class sine Declaration +\*---------------------------------------------------------------------------*/ + +class sine +: + public wallDampingModel +{ + // Private data + + //- Diameter coefficient + const dimensionedScalar Cd_; + + + // Private member functions + + //- Return the force limiter field + tmp<volScalarField> limiter() const; + + +public: + + //- Runtime type information + TypeName("sine"); + + + // Constructors + + //- Construct from components + sine + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~sine(); + + + // Member Functions + + //- Return damped coefficient + virtual tmp<volScalarField> damp + ( + const tmp<volScalarField>& + ) const; + + //- Return damped force + virtual tmp<volVectorField> damp + ( + const tmp<volVectorField>& + ) const; + + //- Return damped face force + virtual tmp<surfaceScalarField> damp + ( + const tmp<surfaceScalarField>& + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace wallDampingModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* //