/*---------------------------------------------------------------------------*\
  ==  == ====== ====   ====    |
                    \\     ||  | Multiphase Code Repository by HZDR
  ======   //   ||  || ===//   | Website: https://doi.org/10.14278/rodare.767
  ||  ||  //    ||  // || \\   | License: GPL-3.0-or-later
  ==  == ====== ====   ==  ==  |
-------------------------------------------------------------------------------
License
    This file is part of the Multiphase Code Repository by HZDR.

    Copyright (C) 2025 by Helmholtz-Zentrum Dresden-Rossendorf e.V. (HZDR),
    Website: https://hzdr.de

    Multiphase Code Repository by HZDR is based on the free software for
    computational fluid dynamics (CFD) from the OpenFOAM Foundation.
    Copyright (C) 2025 by OpenFOAM Foundation, Website: https://openfoam.org

    If you are interested in which files are original OpenFOAM Foundation
    files, which OpenFOAM Foundation files were modified, and which files were
    newly created, see FILES.md.

    Multiphase Code Repository by HZDR 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.

    Multiphase Code Repository by HZDR 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 the Multiphase Code Repository by HZDR. If not, see
    <http://www.gnu.org/licenses/>.

Class
    Foam::RASModels::disperseGasZeroEquation

Description
    Turbulence model for disperse phase which utilises the liquid shear stress
    and scales the liquid Reynold Stress as a function of Stokes number and
    density ratio of disperse to continuous phase.

    \verbatim
        Kamble, V., & Rzehak, R. (2023).
        Turbulent dispersion modeling in bubbly and particulate flows based on
        kinetic theory. EU deliverable.
        cordis.europa.eu/project/id/955805/results
    \endverbatim

SourceFiles
    disperseGasZeroEquation.C

\*---------------------------------------------------------------------------*/

#ifndef disperseGasZeroEquation_H
#define disperseGasZeroEquation_H

#include "RASModel.H"
#include "eddyViscosity.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{
namespace RASModels
{

/*---------------------------------------------------------------------------*\
                  Class disperseGasZeroEquation Declaration
\*---------------------------------------------------------------------------*/

class disperseGasZeroEquation
:
    public eddyViscosity<RASModel<phaseCompressible::momentumTransportModel>>
{
    // Private Data

        //- The phase to which the turbulent model is applied to
        const phaseModel& phase_;

        //- Name of the continuous phase
        const word continuousPhaseName_;

        //- Whether to include the timescale of a bubble crossing an eddy in
        //  the bubble-turbulence timescale
        Switch particleCrossTimeScale_;

        //- Constant to describe the Lagrangian integral timescale following
        //  the fluid motion
        dimensionedScalar CT_;

        //- Constant to describe the Eulerian longitudinal integral length
        //  scale
        dimensionedScalar CLambda_;

        //- Scaling factor for shear stress from liquid to gas phase based on
        //  Stokes number
        volScalarField scalingFactor_;

        //- Scaled turbulent kinematic viscosity from liquid to gas phase based
        //  on Stokes number
        volScalarField nuTurbScaled_;


    // Private Member Functions

        void correctNut()
        {}

        //- Return the continuous phase model
        //  which for two-phases is the "other" phase
        //  and for more than two phases must be specified
        const phaseModel& continuousPhase() const;

        //- Return turbulence of continuous phase
        const phaseCompressible::momentumTransportModel&
            continuousTurbulence() const;


public:

    //- Runtime type information
    TypeName("disperseGasZeroEquation");


    // Constructors

        //- Construct from components
        disperseGasZeroEquation
        (
            const volScalarField& alpha,
            const volScalarField& rho,
            const volVectorField& U,
            const surfaceScalarField& alphaRhoPhi,
            const surfaceScalarField& phi,
            const viscosity& viscosity,
            const word& type = typeName
        );

        //- Disallow default bitwise copy construction
        disperseGasZeroEquation(const disperseGasZeroEquation&) = delete;


    //- Destructor
    virtual ~disperseGasZeroEquation()
    {}


    // Member Functions

        //- Read model coefficients if they have changed
        virtual bool read();

        //- Return the effective viscosity
        virtual tmp<volScalarField> nuEff() const
        {
            return this->nut();
        }

        //- Return the effective viscosity on patch
        virtual tmp<scalarField> nuEff(const label patchi) const
        {
            return this->nut(patchi);
        }

        //- Return the turbulence kinetic energy
        virtual tmp<volScalarField> k() const;

        //- Return the turbulence kinetic energy dissipation rate
        virtual tmp<volScalarField> epsilon() const;

        //- Return the turbulence specific dissipation rate
        virtual tmp<volScalarField> omega() const;

        //- Return the Reynolds stress tensor [m^2/s^2]
        virtual tmp<volSymmTensorField> R() const;

        //- Return the source term for the momentum equation
        virtual tmp<fvVectorMatrix> divDevTau(volVectorField& U) const;

        //- Correct the scaling function and turbulence viscosity
        virtual void correct();


    // Member Operators

        //- Disallow default bitwise assignment
        void operator=(const disperseGasZeroEquation&) = delete;
};


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace RASModels
} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#ifdef NoRepository
    #include "disperseGasZeroEquation.C"
#endif

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif

// ************************************************************************* //
