DiffusionLDGNS.h 5.75 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
///////////////////////////////////////////////////////////////////////////////
//
// File: DiffusionLDGNS.h
//
// For more information, please see: http://www.nektar.info
//
// The MIT License
//
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
// Department of Aeronautics, Imperial College London (UK), and Scientific
// Computing and Imaging Institute, University of Utah (USA).
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: LDG diffusion class.
//
///////////////////////////////////////////////////////////////////////////////

#ifndef NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_DIFFUSIONLDGNS
#define NEKTAR_SOLVERS_COMPRESSIBLEFLOWSOLVER_DIFFUSIONLDGNS

Zhenguo Yan's avatar
TMP  
Zhenguo Yan committed
38 39
#include <boost/core/ignore_unused.hpp>

40
#include <SolverUtils/Diffusion/Diffusion.h>
41
#include <CompressibleFlowSolver/Misc/EquationOfState.h>
Zhenguo Yan's avatar
TMP  
Zhenguo Yan committed
42 43 44
#include <LocalRegions/Expansion3D.h>
#include <LocalRegions/Expansion2D.h>

45 46 47 48 49 50 51 52 53 54

using namespace Nektar::SolverUtils;

namespace Nektar
{
    class DiffusionLDGNS : public Diffusion
    {
    public:
        static DiffusionSharedPtr create(std::string diffType)
        {
Zhenguo Yan's avatar
TMP  
Zhenguo Yan committed
55
            boost::ignore_unused(diffType);
56 57 58 59 60 61 62 63
            return DiffusionSharedPtr(new DiffusionLDGNS());
        }

        static std::string type;

    protected:
        DiffusionLDGNS();

Zhenguo Yan's avatar
TMP  
Zhenguo Yan committed
64 65 66 67 68 69
        /// Penalty coefficient for LDGNS
        NekDouble                            m_C11;

        /// h scaling for penalty term
        Array<OneD, NekDouble>               m_traceOneOverH;

70 71 72 73
        Array<OneD, Array<OneD, NekDouble> > m_traceVel;
        Array<OneD, Array<OneD, NekDouble> > m_traceNormals;
        LibUtilities::SessionReaderSharedPtr m_session;
        NekDouble                            m_Twall;
74 75
        /// Equation of system for computing temperature
        EquationOfStateSharedPtr             m_eos;
76 77 78 79 80

        Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_viscTensor;

        Array<OneD, Array<OneD, NekDouble> > m_homoDerivs;

Zhenguo Yan's avatar
TMP  
Zhenguo Yan committed
81 82
        std::size_t                                  m_spaceDim;
        std::size_t                                  m_diffDim;
83 84 85 86 87 88

        virtual void v_InitObject(
            LibUtilities::SessionReaderSharedPtr               pSession,
            Array<OneD, MultiRegions::ExpListSharedPtr>        pFields);

        virtual void v_Diffuse(
Zhenguo Yan's avatar
TMP  
Zhenguo Yan committed
89
            const std::size_t                                  nConvective,
90 91 92
            const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
            const Array<OneD, Array<OneD, NekDouble> >        &inarray,
                  Array<OneD, Array<OneD, NekDouble> >        &outarray,
Zhenguo Yan's avatar
TMP  
Zhenguo Yan committed
93 94
            const Array<OneD, Array<OneD, NekDouble> > &pFwd,
            const Array<OneD, Array<OneD, NekDouble> > &pBwd);
95

Zhenguo Yan's avatar
TMP  
Zhenguo Yan committed
96
        void NumericalFluxO1(
97 98 99 100
            const Array<OneD, MultiRegions::ExpListSharedPtr>      &fields,
            const Array<OneD, Array<OneD, NekDouble> >             &inarray,
                  Array<OneD, Array<OneD, Array<OneD, NekDouble> > >
                                                        &numericalFluxO1,
Zhenguo Yan's avatar
TMP  
Zhenguo Yan committed
101 102
            const Array<OneD, Array<OneD, NekDouble> > &pFwd,
            const Array<OneD, Array<OneD, NekDouble> > &pBwd);
103

Zhenguo Yan's avatar
TMP  
Zhenguo Yan committed
104
        void ApplyBCsO1(
105 106
            const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
            const Array<OneD, Array<OneD, NekDouble> >        &inarray,
Zhenguo Yan's avatar
TMP  
Zhenguo Yan committed
107 108 109
            const Array<OneD, Array<OneD, NekDouble> >        &pFwd,
            const Array<OneD, Array<OneD, NekDouble> >        &pBwd,
                  Array<OneD, Array<OneD, NekDouble> >        &flux01);
110

Zhenguo Yan's avatar
TMP  
Zhenguo Yan committed
111
        void NumericalFluxO2(
112 113
            const Array<OneD, MultiRegions::ExpListSharedPtr>       &fields,
                  Array<OneD, Array<OneD, Array<OneD, NekDouble> > >&qfield,
Zhenguo Yan's avatar
TMP  
Zhenguo Yan committed
114 115 116
                  Array<OneD, Array<OneD, NekDouble> >              &qflux,
            const Array<OneD, Array<OneD, NekDouble> > &pFwd,
            const Array<OneD, Array<OneD, NekDouble> > &pBwd);
117

Zhenguo Yan's avatar
TMP  
Zhenguo Yan committed
118
        void ApplyBCsO2(
119
            const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
Zhenguo Yan's avatar
TMP  
Zhenguo Yan committed
120 121
            const std::size_t                                  var,
            const std::size_t                                  dir,
122
            const Array<OneD, const NekDouble>                &qfield,
Zhenguo Yan's avatar
TMP  
Zhenguo Yan committed
123 124
            const Array<OneD, const NekDouble>                &qFwd,
            const Array<OneD, const NekDouble>                &qBwd,
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
                  Array<OneD,       NekDouble>                &penaltyflux);

        virtual void v_SetHomoDerivs(
            Array<OneD, Array<OneD, NekDouble> > &deriv)
        {
            m_homoDerivs = deriv;
        }

        virtual Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &v_GetFluxTensor()
        {
            return m_viscTensor;
        }
    };

    typedef std::shared_ptr<DiffusionLDGNS> DiffusionLDGNSSharedPtr;
}

#endif