Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DiffusionLFRNS.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: DiffusionLFRNS.h
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: LFRNS diffusion class.
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERUTILS_DIFFUSIONLFRNS
37 #define NEKTAR_SOLVERUTILS_DIFFUSIONLFRNS
38 
40 
41 namespace Nektar
42 {
43  namespace SolverUtils
44  {
45  class DiffusionLFRNS : public Diffusion
46  {
47  public:
48  static DiffusionSharedPtr create(std::string diffType)
49  {
50  return DiffusionSharedPtr(new DiffusionLFRNS(diffType));
51  }
52 
53  static std::string type[];
54 
55  Array<OneD, NekDouble> m_jac;
56  Array<OneD, Array<OneD, NekDouble> > m_gmat;
57 
58  Array<OneD, Array<OneD, NekDouble> > m_Q2D_e0;
59  Array<OneD, Array<OneD, NekDouble> > m_Q2D_e1;
60  Array<OneD, Array<OneD, NekDouble> > m_Q2D_e2;
61  Array<OneD, Array<OneD, NekDouble> > m_Q2D_e3;
62 
63  Array<OneD, Array<OneD, NekDouble> > m_dGL_xi1;
64  Array<OneD, Array<OneD, NekDouble> > m_dGR_xi1;
65  Array<OneD, Array<OneD, NekDouble> > m_dGL_xi2;
66  Array<OneD, Array<OneD, NekDouble> > m_dGR_xi2;
67  Array<OneD, Array<OneD, NekDouble> > m_dGL_xi3;
68  Array<OneD, Array<OneD, NekDouble> > m_dGR_xi3;
71 
72  protected:
73  DiffusionLFRNS(std::string diffType);
74 
75  Array<OneD, Array<OneD, NekDouble> > m_traceVel;
76  Array<OneD, Array<OneD, NekDouble> > m_traceNormals;
81  std::string m_ViscosityType;
86 
87 
88  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_IF1;
89  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_DU1;
90  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_DFC1;
91  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_BD1;
92  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_D1;
93  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_DD1;
94  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_viscTensor;
95  Array<OneD, Array<OneD, NekDouble> > m_viscFlux;
96  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_DFC2;
97  Array<OneD, Array<OneD, NekDouble> > m_divFD;
98  Array<OneD, Array<OneD, NekDouble> > m_divFC;
99 
100  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_tmp1;
101  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_tmp2;
102 
103  Array<OneD, Array<OneD, NekDouble> > m_homoDerivs;
104 
107 
108  std::string m_diffType;
109 
110  virtual void v_InitObject(
112  Array<OneD, MultiRegions::ExpListSharedPtr> pFields);
113 
114  virtual void v_SetupMetrics(
116  Array<OneD, MultiRegions::ExpListSharedPtr> pFields);
117 
118  virtual void v_SetupCFunctions(
120  Array<OneD, MultiRegions::ExpListSharedPtr> pFields);
121 
122  virtual void v_Diffuse(
123  const int nConvective,
124  const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
125  const Array<OneD, Array<OneD, NekDouble> > &inarray,
126  Array<OneD, Array<OneD, NekDouble> > &outarray);
127 
128  virtual void v_NumericalFluxO1(
129  const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
130  const Array<OneD, Array<OneD, NekDouble> > &inarray,
131  Array<OneD, Array<OneD, Array<OneD, NekDouble> > >
132  &numericalFluxO1);
133 
134  virtual void v_WeakPenaltyO1(
135  const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
136  const Array<OneD, Array<OneD, NekDouble> > &inarray,
137  Array<OneD, Array<OneD, NekDouble> > &penaltyfluxO1);
138 
139  virtual void v_NumericalFluxO2(
140  const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
141  const Array<OneD, Array<OneD, NekDouble> > &ufield,
142  Array<OneD, Array<OneD, Array<OneD, NekDouble> > >&qfield,
143  Array<OneD, Array<OneD, NekDouble> > &qflux);
144 
145  virtual void v_WeakPenaltyO2(
146  const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
147  const int var,
148  const int dir,
149  const Array<OneD, const NekDouble> &qfield,
150  Array<OneD, NekDouble> &penaltyflux);
151 
152  virtual void v_DerCFlux_1D(
153  const int nConvectiveFields,
154  const Array<OneD, MultiRegions::ExpListSharedPtr>&fields,
155  const Array<OneD, const NekDouble> &flux,
156  const Array<OneD, const NekDouble> &iFlux,
157  Array<OneD, NekDouble> &derCFlux);
158 
159  virtual void v_DerCFlux_2D(
160  const int nConvectiveFields,
161  const int direction,
162  const Array<OneD, MultiRegions::ExpListSharedPtr>&fields,
163  const Array<OneD, const NekDouble> &flux,
164  const Array<OneD, NekDouble> &iFlux,
165  Array<OneD, NekDouble> &derCFlux);
166 
167  virtual void v_DivCFlux_2D(
168  const int nConvectiveFields,
169  const Array<OneD, MultiRegions::ExpListSharedPtr>&fields,
170  const Array<OneD, const NekDouble> &fluxX1,
171  const Array<OneD, const NekDouble> &fluxX2,
172  const Array<OneD, const NekDouble> &numericalFlux,
173  Array<OneD, NekDouble> &divCFlux);
174 
175  virtual void v_DivCFlux_2D_Gauss(
176  const int nConvectiveFields,
177  const Array<OneD, MultiRegions::ExpListSharedPtr>&fields,
178  const Array<OneD, const NekDouble> &fluxX1,
179  const Array<OneD, const NekDouble> &fluxX2,
180  const Array<OneD, const NekDouble> &numericalFlux,
181  Array<OneD, NekDouble> &divCFlux);
182 
183  virtual void v_FluxVec(
184  Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &fluxvector)
185  {
186  fluxvector = m_viscTensor;
187  };
188 
189  virtual void v_SetHomoDerivs(
190  Array<OneD, Array<OneD, NekDouble> > &deriv)
191  {
192  m_homoDerivs = deriv;
193  }
194 
195  virtual Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &v_GetFluxTensor()
196  {
197  return m_viscTensor;
198  }
199  };
200 
201  typedef boost::shared_ptr<DiffusionLFRNS> DiffusionLFRNSSharedPtr;
202  }
203 }
204 
205 #endif
206