Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DiffusionLDGNS.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File: DiffusionLDGNS.cpp
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: LDGNS diffusion class.
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
37 #include <iostream>
38 #include <iomanip>
39 
41 
42 namespace Nektar
43 {
44  namespace SolverUtils
45  {
47  RegisterCreatorFunction("LDGNS", DiffusionLDGNS::create);
48 
50  {
51  }
52 
56  {
57  m_session = pSession;
58  m_session->LoadParameter ("Gamma", m_gamma, 1.4);
59  m_session->LoadParameter ("GasConstant", m_gasConstant, 287.058);
60  m_session->LoadParameter ("Twall", m_Twall, 300.15);
61  m_session->LoadSolverInfo("ViscosityType", m_ViscosityType,
62  "Constant");
63  m_session->LoadParameter ("mu", m_mu, 1.78e-05);
64  m_session->LoadParameter ("thermalConductivity",
65  m_thermalConductivity, 0.0257);
66  m_session->LoadParameter ("rhoInf", m_rhoInf, 1.225);
67  m_session->LoadParameter ("pInf", m_pInf, 101325);
68 
69  // Setting up the normals
70  int i;
71  int nDim = pFields[0]->GetCoordim(0);
72  int nTracePts = pFields[0]->GetTrace()->GetTotPoints();
73 
74  m_spaceDim = nDim;
75  if (pSession->DefinesSolverInfo("HOMOGENEOUS"))
76  {
77  m_spaceDim = 3;
78  }
79 
80  m_diffDim = m_spaceDim - nDim;
81 
84  for(i = 0; i < m_spaceDim; ++i)
85  {
86  m_traceVel[i] = Array<OneD, NekDouble> (nTracePts, 0.0);
87  m_traceNormals[i] = Array<OneD, NekDouble> (nTracePts);
88  }
89  pFields[0]->GetTrace()->GetNormals(m_traceNormals);
90  }
91 
92  /**
93  * @brief Calculate weak DG Diffusion in the LDG form for the
94  * Navier-Stokes (NS) equations:
95  *
96  * \f$ \langle\psi, \hat{u}\cdot n\rangle
97  * - \langle\nabla\psi \cdot u\rangle
98  * \langle\phi, \hat{q}\cdot n\rangle -
99  * (\nabla \phi \cdot q) \rangle \f$
100  *
101  * The equations that need a diffusion operator are those related
102  * with the velocities and with the energy.
103  *
104  */
106  const int nConvectiveFields,
108  const Array<OneD, Array<OneD, NekDouble> > &inarray,
109  Array<OneD, Array<OneD, NekDouble> > &outarray)
110  {
111  int i, j;
112  int nDim = fields[0]->GetCoordim(0);
113  int nScalars = inarray.num_elements();
114  int nPts = fields[0]->GetTotPoints();
115  int nCoeffs = fields[0]->GetNcoeffs();
116  int nTracePts = fields[0]->GetTrace()->GetTotPoints();
117 
118  Array<OneD, NekDouble> tmp1(nCoeffs);
119  Array<OneD, Array<OneD, NekDouble> > tmp2(nConvectiveFields);
120 
122  numericalFluxO1(m_spaceDim);
124  derivativesO1(m_spaceDim);
125 
127 
128  for (j = 0; j < m_spaceDim; ++j)
129  {
130  numericalFluxO1[j] = Array<OneD, Array<OneD, NekDouble> >(
131  nScalars);
132  derivativesO1[j] = Array<OneD, Array<OneD, NekDouble> >(
133  nScalars);
134 
135  for (i = 0; i < nScalars; ++i)
136  {
137  numericalFluxO1[j][i] = Array<OneD, NekDouble>(
138  nTracePts, 0.0);
139  derivativesO1[j][i] = Array<OneD, NekDouble>(nPts, 0.0);
140  }
141  }
142 
143  // Compute the numerical fluxes for the first order derivatives
144  v_NumericalFluxO1(fields, inarray, numericalFluxO1);
145 
146  for (j = 0; j < nDim; ++j)
147  {
148  for (i = 0; i < nScalars; ++i)
149  {
150  fields[i]->IProductWRTDerivBase (j, inarray[i], tmp1);
151  Vmath::Neg (nCoeffs, tmp1, 1);
152  fields[i]->AddTraceIntegral (numericalFluxO1[j][i],
153  tmp1);
154  fields[i]->SetPhysState (false);
155  fields[i]->MultiplyByElmtInvMass(tmp1, tmp1);
156  fields[i]->BwdTrans (tmp1, derivativesO1[j][i]);
157  }
158  }
159 
160  // For 3D Homogeneous 1D only take derivatives in 3rd direction
161  if (m_diffDim == 1)
162  {
163  for (i = 0; i < nScalars; ++i)
164  {
165  derivativesO1[2][i] = m_homoDerivs[i];
166  }
167  }
168 
169  // Initialisation viscous tensor
171  (m_spaceDim);
172  Array<OneD, Array<OneD, NekDouble> > viscousFlux(nConvectiveFields);
173 
174  for (j = 0; j < m_spaceDim; ++j)
175  {
177  nScalars+1);
178  for (i = 0; i < nScalars+1; ++i)
179  {
180  m_viscTensor[j][i] = Array<OneD, NekDouble>(nPts, 0.0);
181  }
182  }
183 
184  for (i = 0; i < nConvectiveFields; ++i)
185  {
186  viscousFlux[i] = Array<OneD, NekDouble>(nTracePts, 0.0);
187  }
188 
189  m_fluxVectorNS(inarray, derivativesO1, m_viscTensor);
190 
191  // Compute u from q_{\eta} and q_{\xi}
192  // Obtain numerical fluxes
193  v_NumericalFluxO2(fields, inarray, m_viscTensor, viscousFlux);
194 
195  for (i = 0; i < nConvectiveFields; ++i)
196  {
197  tmp2[i] = Array<OneD, NekDouble>(nCoeffs, 0.0);
198 
199  for (j = 0; j < nDim; ++j)
200  {
201  fields[i]->IProductWRTDerivBase(j, m_viscTensor[j][i], tmp1);
202  Vmath::Vadd(nCoeffs, tmp1, 1, tmp2[i], 1, tmp2[i], 1);
203  }
204 
205  // Evaulate <\phi, \hat{F}\cdot n> - outarray[i]
206  Vmath::Neg (nCoeffs, tmp2[i], 1);
207  fields[i]->AddTraceIntegral (viscousFlux[i], tmp2[i]);
208  fields[i]->SetPhysState (false);
209  fields[i]->MultiplyByElmtInvMass(tmp2[i], tmp2[i]);
210  fields[i]->BwdTrans (tmp2[i], outarray[i]);
211  }
212  }
213 
214  /**
215  * @brief Builds the numerical flux for the 1st order derivatives
216  *
217  */
220  const Array<OneD, Array<OneD, NekDouble> > &inarray,
222  &numericalFluxO1)
223  {
224  int i, j;
225  int nTracePts = fields[0]->GetTrace()->GetTotPoints();
226  int nScalars = inarray.num_elements();
227  int nDim = fields[0]->GetCoordim(0);
228 
229  Array<OneD, NekDouble > Vn (nTracePts, 0.0);
230  Array<OneD, NekDouble > fluxtemp(nTracePts, 0.0);
231 
232  // Get the normal velocity Vn
233  for(i = 0; i < nDim; ++i)
234  {
235  Vmath::Svtvp(nTracePts, 1.0, m_traceNormals[i], 1,
236  Vn, 1, Vn, 1);
237  }
238 
239  // Store forwards/backwards space along trace space
240  Array<OneD, Array<OneD, NekDouble> > Fwd (nScalars);
241  Array<OneD, Array<OneD, NekDouble> > Bwd (nScalars);
242  Array<OneD, Array<OneD, NekDouble> > numflux(nScalars);
243 
244  for (i = 0; i < nScalars; ++i)
245  {
246  Fwd[i] = Array<OneD, NekDouble>(nTracePts);
247  Bwd[i] = Array<OneD, NekDouble>(nTracePts);
248  numflux[i] = Array<OneD, NekDouble>(nTracePts);
249  fields[i]->GetFwdBwdTracePhys(inarray[i], Fwd[i], Bwd[i]);
250  fields[0]->GetTrace()->Upwind(Vn, Fwd[i], Bwd[i], numflux[i]);
251  }
252 
253  // Extract internal values of the scalar variables for Neumann bcs
254  Array< OneD, Array<OneD, NekDouble > > uplus(nScalars);
255 
256  for (i = 0; i < nScalars; ++i)
257  {
258  uplus[i] = Array<OneD, NekDouble>(nTracePts, 0.0);
259  fields[i]->ExtractTracePhys(inarray[i], uplus[i]);
260  }
261 
262  // Modify the values in case of boundary interfaces
263  if (fields[0]->GetBndCondExpansions().num_elements())
264  {
265  v_WeakPenaltyO1(fields, inarray, uplus, numflux);
266  }
267 
268  // Splitting the numerical flux into the dimensions
269  for (j = 0; j < m_spaceDim; ++j)
270  {
271  for (i = 0; i < nScalars; ++i)
272  {
273  Vmath::Vmul(nTracePts, m_traceNormals[j], 1,
274  numflux[i], 1, numericalFluxO1[j][i], 1);
275  }
276  }
277  }
278 
279  /**
280  * @brief Imposes appropriate bcs for the 1st order derivatives
281  *
282  */
285  const Array<OneD, Array<OneD, NekDouble> > &inarray,
286  const Array<OneD, Array<OneD, NekDouble> > &uplus,
287  Array<OneD, Array<OneD, NekDouble> > &penaltyfluxO1)
288  {
289  int cnt;
290  int i, j, e;
291  int id1, id2;
292 
293  int nBndEdgePts, nBndEdges, nBndRegions;
294 
295  int nTracePts = fields[0]->GetTrace()->GetTotPoints();
296  int nScalars = inarray.num_elements();
297 
298  Array<OneD, NekDouble> tmp1(nTracePts, 0.0);
299  Array<OneD, NekDouble> tmp2(nTracePts, 0.0);
300  Array<OneD, NekDouble> Tw(nTracePts, m_Twall);
301 
302  Array< OneD, Array<OneD, NekDouble > > scalarVariables(nScalars);
303 
304  // Extract internal values of the scalar variables for Neumann bcs
305  for (i = 0; i < nScalars; ++i)
306  {
307  scalarVariables[i] = Array<OneD, NekDouble>(nTracePts, 0.0);
308  }
309 
310  // Compute boundary conditions for velocities
311  for (i = 0; i < nScalars-1; ++i)
312  {
313  // Note that cnt has to loop on nBndRegions and nBndEdges
314  // and has to be reset to zero per each equation
315  cnt = 0;
316  nBndRegions = fields[i+1]->
317  GetBndCondExpansions().num_elements();
318  for (j = 0; j < nBndRegions; ++j)
319  {
320  nBndEdges = fields[i+1]->
321  GetBndCondExpansions()[j]->GetExpSize();
322  for (e = 0; e < nBndEdges; ++e)
323  {
324  nBndEdgePts = fields[i+1]->
325  GetBndCondExpansions()[j]->GetExp(e)->GetTotPoints();
326 
327  id1 = fields[i+1]->
328  GetBndCondExpansions()[j]->GetPhys_Offset(e);
329 
330  id2 = fields[0]->GetTrace()->
331  GetPhys_Offset(fields[0]->GetTraceMap()->
332  GetBndCondTraceToGlobalTraceMap(cnt++));
333 
334  // Reinforcing bcs for velocity in case of Wall bcs
335  if (boost::iequals(fields[i]->GetBndConditions()[j]->
336  GetUserDefined(),"WallViscous") ||
337  boost::iequals(fields[i]->GetBndConditions()[j]->
338  GetUserDefined(),"WallAdiabatic"))
339  {
340  Vmath::Zero(nBndEdgePts,
341  &scalarVariables[i][id2], 1);
342 
343  }
344 
345  // Imposing velocity bcs if not Wall
346  else if (fields[i]->GetBndConditions()[j]->
347  GetBoundaryConditionType() ==
349  {
350  Vmath::Vdiv(nBndEdgePts,
351  &(fields[i+1]->GetBndCondExpansions()[j]->
352  UpdatePhys())[id1], 1,
353  &(fields[0]->GetBndCondExpansions()[j]->
354  UpdatePhys())[id1], 1,
355  &scalarVariables[i][id2], 1);
356  }
357 
358  // For Dirichlet boundary condition: uflux = u_bcs
359  if (fields[i]->GetBndConditions()[j]->
360  GetBoundaryConditionType() ==
362  {
363  Vmath::Vcopy(nBndEdgePts,
364  &scalarVariables[i][id2], 1,
365  &penaltyfluxO1[i][id2], 1);
366  }
367 
368  // For Neumann boundary condition: uflux = u_+
369  else if ((fields[i]->GetBndConditions()[j])->
370  GetBoundaryConditionType() ==
372  {
373  Vmath::Vcopy(nBndEdgePts,
374  &uplus[i][id2], 1,
375  &penaltyfluxO1[i][id2], 1);
376  }
377 
378  // Building kinetic energy to be used for T bcs
379  Vmath::Vmul(nBndEdgePts,
380  &scalarVariables[i][id2], 1,
381  &scalarVariables[i][id2], 1,
382  &tmp1[id2], 1);
383 
384  Vmath::Smul(nBndEdgePts, 0.5,
385  &tmp1[id2], 1,
386  &tmp1[id2], 1);
387 
388  Vmath::Vadd(nBndEdgePts,
389  &tmp2[id2], 1,
390  &tmp1[id2], 1,
391  &tmp2[id2], 1);
392  }
393  }
394  }
395 
396  // Compute boundary conditions for temperature
397  cnt = 0;
398  nBndRegions = fields[nScalars]->
399  GetBndCondExpansions().num_elements();
400  for (j = 0; j < nBndRegions; ++j)
401  {
402  nBndEdges = fields[nScalars]->
403  GetBndCondExpansions()[j]->GetExpSize();
404  for (e = 0; e < nBndEdges; ++e)
405  {
406  nBndEdgePts = fields[nScalars]->
407  GetBndCondExpansions()[j]->GetExp(e)->GetTotPoints();
408 
409  id1 = fields[nScalars]->
410  GetBndCondExpansions()[j]->GetPhys_Offset(e);
411 
412  id2 = fields[0]->GetTrace()->
413  GetPhys_Offset(fields[0]->GetTraceMap()->
414  GetBndCondTraceToGlobalTraceMap(cnt++));
415 
416  // Imposing Temperature Twall at the wall
417  if (boost::iequals(fields[i]->GetBndConditions()[j]->
418  GetUserDefined(),"WallViscous"))
419  {
420  Vmath::Vcopy(nBndEdgePts,
421  &Tw[0], 1,
422  &scalarVariables[nScalars-1][id2], 1);
423  }
424  // Imposing Temperature through condition on the Energy
425  // for no wall boundaries (e.g. farfield)
426  else if (fields[i]->GetBndConditions()[j]->
427  GetBoundaryConditionType() ==
429  {
430  // Divide E by rho
431  Vmath::Vdiv(nBndEdgePts,
432  &(fields[nScalars]->
433  GetBndCondExpansions()[j]->
434  GetPhys())[id1], 1,
435  &(fields[0]->
436  GetBndCondExpansions()[j]->
437  GetPhys())[id1], 1,
438  &scalarVariables[nScalars-1][id2], 1);
439 
440  // Subtract kinetic energy to E/rho
441  Vmath::Vsub(nBndEdgePts,
442  &scalarVariables[nScalars-1][id2], 1,
443  &tmp2[id2], 1,
444  &scalarVariables[nScalars-1][id2], 1);
445 
446  // Multiply by constant factor (gamma-1)/R
447  Vmath::Smul(nBndEdgePts, (m_gamma - 1)/m_gasConstant,
448  &scalarVariables[nScalars-1][id2], 1,
449  &scalarVariables[nScalars-1][id2], 1);
450  }
451 
452  // For Dirichlet boundary condition: uflux = u_bcs
453  if (fields[nScalars]->GetBndConditions()[j]->
454  GetBoundaryConditionType() ==
456  !boost::iequals(
457  fields[nScalars]->GetBndConditions()[j]
458  ->GetUserDefined(), "WallAdiabatic"))
459  {
460  Vmath::Vcopy(nBndEdgePts,
461  &scalarVariables[nScalars-1][id2], 1,
462  &penaltyfluxO1[nScalars-1][id2], 1);
463 
464  }
465 
466  // For Neumann boundary condition: uflux = u_+
467  else if (((fields[nScalars]->GetBndConditions()[j])->
468  GetBoundaryConditionType() ==
470  boost::iequals(fields[nScalars]->GetBndConditions()[j]->
471  GetUserDefined(), "WallAdiabatic"))
472  {
473  Vmath::Vcopy(nBndEdgePts,
474  &uplus[nScalars-1][id2], 1,
475  &penaltyfluxO1[nScalars-1][id2], 1);
476 
477  }
478  }
479  }
480  }
481 
482  /**
483  * @brief Build the numerical flux for the 2nd order derivatives
484  *
485  */
488  const Array<OneD, Array<OneD, NekDouble> > &ufield,
491  {
492  int i, j;
493  int nTracePts = fields[0]->GetTrace()->GetTotPoints();
494  int nVariables = fields.num_elements();
495  int nDim = fields[0]->GetCoordim(0);
496 
497  Array<OneD, NekDouble > Fwd(nTracePts);
498  Array<OneD, NekDouble > Bwd(nTracePts);
499  Array<OneD, NekDouble > Vn (nTracePts, 0.0);
500 
501  Array<OneD, NekDouble > qFwd (nTracePts);
502  Array<OneD, NekDouble > qBwd (nTracePts);
503  Array<OneD, NekDouble > qfluxtemp(nTracePts, 0.0);
504 
505  // Get the normal velocity Vn
506  for(i = 0; i < nDim; ++i)
507  {
508  Vmath::Svtvp(nTracePts, 1.0, m_traceNormals[i], 1,
509  Vn, 1, Vn, 1);
510  }
511 
512  Array<OneD, NekDouble > qtemp(nTracePts);
513 
514  // Evaulate Riemann flux
515  // qflux = \hat{q} \cdot u = q \cdot n
516  // Notice: i = 1 (first row of the viscous tensor is zero)
517  for (i = 1; i < nVariables; ++i)
518  {
519  qflux[i] = Array<OneD, NekDouble> (nTracePts, 0.0);
520  for (j = 0; j < nDim; ++j)
521  {
522  // Compute qFwd and qBwd value of qfield in position 'ji'
523  fields[i]->GetFwdBwdTracePhys(qfield[j][i], qFwd, qBwd);
524 
525  // Get Riemann flux of qflux --> LDG implies upwind
526  fields[i]->GetTrace()->Upwind(Vn, qBwd, qFwd, qfluxtemp);
527 
528  // Multiply the Riemann flux by the trace normals
529  Vmath::Vmul(nTracePts, m_traceNormals[j], 1, qfluxtemp, 1,
530  qfluxtemp, 1);
531 
532  // Extract the physical values of the solution at the boundaries
533  fields[i]->ExtractTracePhys(qfield[j][i], qtemp);
534 
535  // Impose weak boundary condition with flux
536  if (fields[0]->GetBndCondExpansions().num_elements())
537  {
538  v_WeakPenaltyO2(fields, i, j, qfield[j][i], qtemp, qfluxtemp);
539  }
540 
541  // Store the final flux into qflux
542  Vmath::Vadd(nTracePts, qfluxtemp, 1, qflux[i], 1,
543  qflux[i], 1);
544  }
545  }
546  }
547 
548 
549  /**
550  * @brief Imposes appropriate bcs for the 2nd order derivatives
551  *
552  */
555  const int var,
556  const int dir,
557  const Array<OneD, const NekDouble> &qfield,
558  const Array<OneD, const NekDouble> &qtemp,
559  Array<OneD, NekDouble> &penaltyflux)
560  {
561  int cnt = 0;
562  int nBndEdges, nBndEdgePts;
563  int i, e;
564  int id2;
565 
566  int nTracePts = fields[0]->GetTrace()->GetTotPoints();
567  int nBndRegions = fields[var]->GetBndCondExpansions().num_elements();
568 
569  Array<OneD, NekDouble > uterm(nTracePts);
570 
571  // Loop on the boundary regions to apply appropriate bcs
572  for (i = 0; i < nBndRegions; ++i)
573  {
574  // Number of boundary regions related to region 'i'
575  nBndEdges = fields[var]->
576  GetBndCondExpansions()[i]->GetExpSize();
577 
578  // Weakly impose bcs by modifying flux values
579  for (e = 0; e < nBndEdges; ++e)
580  {
581  nBndEdgePts = fields[var]->
582  GetBndCondExpansions()[i]->GetExp(e)->GetTotPoints();
583 
584  id2 = fields[0]->GetTrace()->
585  GetPhys_Offset(fields[0]->GetTraceMap()->
586  GetBndCondTraceToGlobalTraceMap(cnt++));
587 
588  // In case of Dirichlet bcs:
589  // uflux = gD
590  if(fields[var]->GetBndConditions()[i]->
591  GetBoundaryConditionType() == SpatialDomains::eDirichlet
592  && !boost::iequals(fields[var]->GetBndConditions()[i]->
593  GetUserDefined(), "WallAdiabatic"))
594  {
595  Vmath::Vmul(nBndEdgePts,
596  &m_traceNormals[dir][id2], 1,
597  &qtemp[id2], 1,
598  &penaltyflux[id2], 1);
599  }
600  // 3.4) In case of Neumann bcs:
601  // uflux = u+
602  else if((fields[var]->GetBndConditions()[i])->
603  GetBoundaryConditionType() == SpatialDomains::eNeumann)
604  {
605  ASSERTL0(false,
606  "Neumann bcs not implemented for LDGNS");
607 
608  /*
609  Vmath::Vmul(nBndEdgePts,
610  &m_traceNormals[dir][id2], 1,
611  &(fields[var]->
612  GetBndCondExpansions()[i]->
613  UpdatePhys())[id1], 1,
614  &penaltyflux[id2], 1);
615  */
616  }
617  else if(boost::iequals(fields[var]->GetBndConditions()[i]->
618  GetUserDefined(), "WallAdiabatic"))
619  {
620  if ((var == m_spaceDim + 1))
621  {
622  Vmath::Zero(nBndEdgePts, &penaltyflux[id2], 1);
623  }
624  else
625  {
626 
627  Vmath::Vmul(nBndEdgePts,
628  &m_traceNormals[dir][id2], 1,
629  &qtemp[id2], 1,
630  &penaltyflux[id2], 1);
631 
632  }
633  }
634  }
635  }
636  }
637  }//end of namespace SolverUtils
638 }//end of namespace Nektar
Array< OneD, Array< OneD, NekDouble > > m_traceNormals
Array< OneD, Array< OneD, NekDouble > > m_homoDerivs
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
static DiffusionSharedPtr create(std::string diffType)
DiffusionFactory & GetDiffusionFactory()
Definition: Diffusion.cpp:42
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
Definition: Vmath.cpp:471
virtual void v_WeakPenaltyO2(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const int var, const int dir, const Array< OneD, const NekDouble > &qfield, const Array< OneD, const NekDouble > &qtemp, Array< OneD, NekDouble > &penaltyflux)
Imposes appropriate bcs for the 2nd order derivatives.
virtual void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
Definition: Vmath.cpp:227
DiffusionFluxVecCBNS m_fluxVectorNS
Definition: Diffusion.h:133
LibUtilities::SessionReaderSharedPtr m_session
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:51
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > m_viscTensor
Array< OneD, Array< OneD, NekDouble > > m_traceVel
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:199
virtual void v_WeakPenaltyO1(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, const Array< OneD, Array< OneD, NekDouble > > &uplus, Array< OneD, Array< OneD, NekDouble > > &penaltyfluxO1)
Imposes appropriate bcs for the 1st order derivatives.
void Neg(int n, T *x, const int incx)
Negate x = -x.
Definition: Vmath.cpp:382
virtual void v_NumericalFluxO2(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &ufield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &qfield, Array< OneD, Array< OneD, NekDouble > > &qflux)
Build the numerical flux for the 2nd order derivatives.
virtual void v_NumericalFluxO1(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &numericalFluxO1)
Builds the numerical flux for the 1st order derivatives.
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
Definition: Vmath.cpp:329
virtual void v_Diffuse(const int nConvective, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
Calculate weak DG Diffusion in the LDG form for the Navier-Stokes (NS) equations: ...
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:359
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1047
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:285
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:169