Commit 7197f686 authored by Henry Weller's avatar Henry Weller
Browse files

reactingEulerFoam/interfacialModels/wallDampingModels: Added cosine and sine damping functions

parent 6a59811e
......@@ -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
/*---------------------------------------------------------------------------*\
========= |
\\ / 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;
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
// ************************************************************************* //
......@@ -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));
}
......
/*---------------------------------------------------------------------------*\
========= |
\\ / 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;
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
// ************************************************************************* //
Supports Markdown
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