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  // Modify the values in case of boundary interfaces
254  if (fields[0]->GetBndCondExpansions().num_elements())
255  {
256  v_WeakPenaltyO1(fields, inarray, numflux);
257  }
258 
259  // Splitting the numerical flux into the dimensions
260  for (j = 0; j < m_spaceDim; ++j)
261  {
262  for (i = 0; i < nScalars; ++i)
263  {
264  Vmath::Vmul(nTracePts, m_traceNormals[j], 1,
265  numflux[i], 1, numericalFluxO1[j][i], 1);
266  }
267  }
268  }
269 
270  /**
271  * @brief Imposes appropriate bcs for the 1st order derivatives
272  *
273  */
276  const Array<OneD, Array<OneD, NekDouble> > &inarray,
277  Array<OneD, Array<OneD, NekDouble> > &penaltyfluxO1)
278  {
279  int cnt;
280  int i, j, e;
281  int id1, id2;
282 
283  int nBndEdgePts, nBndEdges, nBndRegions;
284 
285  int nTracePts = fields[0]->GetTrace()->GetTotPoints();
286  int nScalars = inarray.num_elements();
287 
288  Array<OneD, NekDouble> tmp1(nTracePts, 0.0);
289  Array<OneD, NekDouble> tmp2(nTracePts, 0.0);
290  Array<OneD, NekDouble> Tw(nTracePts, m_Twall);
291 
292  Array< OneD, Array<OneD, NekDouble > > scalarVariables(nScalars);
293  Array< OneD, Array<OneD, NekDouble > > uplus(nScalars);
294 
295  // Extract internal values of the scalar variables for Neumann bcs
296  for (i = 0; i < nScalars; ++i)
297  {
298  scalarVariables[i] = Array<OneD, NekDouble>(nTracePts, 0.0);
299 
300  uplus[i] = Array<OneD, NekDouble>(nTracePts, 0.0);
301  fields[i]->ExtractTracePhys(inarray[i], uplus[i]);
302  }
303 
304  // Compute boundary conditions for velocities
305  for (i = 0; i < nScalars-1; ++i)
306  {
307  // Note that cnt has to loop on nBndRegions and nBndEdges
308  // and has to be reset to zero per each equation
309  cnt = 0;
310  nBndRegions = fields[i+1]->
311  GetBndCondExpansions().num_elements();
312  for (j = 0; j < nBndRegions; ++j)
313  {
314  nBndEdges = fields[i+1]->
315  GetBndCondExpansions()[j]->GetExpSize();
316  for (e = 0; e < nBndEdges; ++e)
317  {
318  nBndEdgePts = fields[i+1]->
319  GetBndCondExpansions()[j]->GetExp(e)->GetTotPoints();
320 
321  id1 = fields[i+1]->
322  GetBndCondExpansions()[j]->GetPhys_Offset(e);
323 
324  id2 = fields[0]->GetTrace()->
325  GetPhys_Offset(fields[0]->GetTraceMap()->
326  GetBndCondTraceToGlobalTraceMap(cnt++));
327 
328  // Reinforcing bcs for velocity in case of Wall bcs
329  if (boost::iequals(fields[i]->GetBndConditions()[j]->
330  GetUserDefined(),"WallViscous") ||
331  boost::iequals(fields[i]->GetBndConditions()[j]->
332  GetUserDefined(),"WallAdiabatic"))
333  {
334  Vmath::Zero(nBndEdgePts,
335  &scalarVariables[i][id2], 1);
336 
337  }
338 
339  // Imposing velocity bcs if not Wall
340  else if (fields[i]->GetBndConditions()[j]->
341  GetBoundaryConditionType() ==
343  {
344  Vmath::Vdiv(nBndEdgePts,
345  &(fields[i+1]->GetBndCondExpansions()[j]->
346  UpdatePhys())[id1], 1,
347  &(fields[0]->GetBndCondExpansions()[j]->
348  UpdatePhys())[id1], 1,
349  &scalarVariables[i][id2], 1);
350  }
351 
352  // For Dirichlet boundary condition: uflux = u_bcs
353  if (fields[i]->GetBndConditions()[j]->
354  GetBoundaryConditionType() ==
356  {
357  Vmath::Vcopy(nBndEdgePts,
358  &scalarVariables[i][id2], 1,
359  &penaltyfluxO1[i][id2], 1);
360  }
361 
362  // For Neumann boundary condition: uflux = u_+
363  else if ((fields[i]->GetBndConditions()[j])->
364  GetBoundaryConditionType() ==
366  {
367  Vmath::Vcopy(nBndEdgePts,
368  &uplus[i][id2], 1,
369  &penaltyfluxO1[i][id2], 1);
370  }
371 
372  // Building kinetic energy to be used for T bcs
373  Vmath::Vmul(nBndEdgePts,
374  &scalarVariables[i][id2], 1,
375  &scalarVariables[i][id2], 1,
376  &tmp1[id2], 1);
377 
378  Vmath::Smul(nBndEdgePts, 0.5,
379  &tmp1[id2], 1,
380  &tmp1[id2], 1);
381 
382  Vmath::Vadd(nBndEdgePts,
383  &tmp2[id2], 1,
384  &tmp1[id2], 1,
385  &tmp2[id2], 1);
386  }
387  }
388  }
389 
390  // Compute boundary conditions for temperature
391  cnt = 0;
392  nBndRegions = fields[nScalars]->
393  GetBndCondExpansions().num_elements();
394  for (j = 0; j < nBndRegions; ++j)
395  {
396  nBndEdges = fields[nScalars]->
397  GetBndCondExpansions()[j]->GetExpSize();
398  for (e = 0; e < nBndEdges; ++e)
399  {
400  nBndEdgePts = fields[nScalars]->
401  GetBndCondExpansions()[j]->GetExp(e)->GetTotPoints();
402 
403  id1 = fields[nScalars]->
404  GetBndCondExpansions()[j]->GetPhys_Offset(e);
405 
406  id2 = fields[0]->GetTrace()->
407  GetPhys_Offset(fields[0]->GetTraceMap()->
408  GetBndCondTraceToGlobalTraceMap(cnt++));
409 
410  // Imposing Temperature Twall at the wall
411  if (boost::iequals(fields[i]->GetBndConditions()[j]->
412  GetUserDefined(),"WallViscous"))
413  {
414  Vmath::Vcopy(nBndEdgePts,
415  &Tw[0], 1,
416  &scalarVariables[nScalars-1][id2], 1);
417  }
418  // Imposing Temperature through condition on the Energy
419  // for no wall boundaries (e.g. farfield)
420  else if (fields[i]->GetBndConditions()[j]->
421  GetBoundaryConditionType() ==
423  {
424  // Divide E by rho
425  Vmath::Vdiv(nBndEdgePts,
426  &(fields[nScalars]->
427  GetBndCondExpansions()[j]->
428  GetPhys())[id1], 1,
429  &(fields[0]->
430  GetBndCondExpansions()[j]->
431  GetPhys())[id1], 1,
432  &scalarVariables[nScalars-1][id2], 1);
433 
434  // Subtract kinetic energy to E/rho
435  Vmath::Vsub(nBndEdgePts,
436  &scalarVariables[nScalars-1][id2], 1,
437  &tmp2[id2], 1,
438  &scalarVariables[nScalars-1][id2], 1);
439 
440  // Multiply by constant factor (gamma-1)/R
441  Vmath::Smul(nBndEdgePts, (m_gamma - 1)/m_gasConstant,
442  &scalarVariables[nScalars-1][id2], 1,
443  &scalarVariables[nScalars-1][id2], 1);
444  }
445 
446  // For Dirichlet boundary condition: uflux = u_bcs
447  if (fields[nScalars]->GetBndConditions()[j]->
448  GetBoundaryConditionType() ==
450  !boost::iequals(
451  fields[nScalars]->GetBndConditions()[j]
452  ->GetUserDefined(), "WallAdiabatic"))
453  {
454  Vmath::Vcopy(nBndEdgePts,
455  &scalarVariables[nScalars-1][id2], 1,
456  &penaltyfluxO1[nScalars-1][id2], 1);
457 
458  }
459 
460  // For Neumann boundary condition: uflux = u_+
461  else if (((fields[nScalars]->GetBndConditions()[j])->
462  GetBoundaryConditionType() ==
464  boost::iequals(fields[nScalars]->GetBndConditions()[j]->
465  GetUserDefined(), "WallAdiabatic"))
466  {
467  Vmath::Vcopy(nBndEdgePts,
468  &uplus[nScalars-1][id2], 1,
469  &penaltyfluxO1[nScalars-1][id2], 1);
470 
471  }
472  }
473  }
474  }
475 
476  /**
477  * @brief Build the numerical flux for the 2nd order derivatives
478  *
479  */
482  const Array<OneD, Array<OneD, NekDouble> > &ufield,
485  {
486  int i, j;
487  int nTracePts = fields[0]->GetTrace()->GetTotPoints();
488  int nVariables = fields.num_elements();
489  int nDim = fields[0]->GetCoordim(0);
490 
491  Array<OneD, NekDouble > Fwd(nTracePts);
492  Array<OneD, NekDouble > Bwd(nTracePts);
493  Array<OneD, NekDouble > Vn (nTracePts, 0.0);
494 
495  Array<OneD, NekDouble > qFwd (nTracePts);
496  Array<OneD, NekDouble > qBwd (nTracePts);
497  Array<OneD, NekDouble > qfluxtemp(nTracePts, 0.0);
498 
499  // Get the normal velocity Vn
500  for(i = 0; i < nDim; ++i)
501  {
502  Vmath::Svtvp(nTracePts, 1.0, m_traceNormals[i], 1,
503  Vn, 1, Vn, 1);
504  }
505 
506  // Evaulate Riemann flux
507  // qflux = \hat{q} \cdot u = q \cdot n
508  // Notice: i = 1 (first row of the viscous tensor is zero)
509  for (i = 1; i < nVariables; ++i)
510  {
511  qflux[i] = Array<OneD, NekDouble> (nTracePts, 0.0);
512  for (j = 0; j < nDim; ++j)
513  {
514  // Compute qFwd and qBwd value of qfield in position 'ji'
515  fields[i]->GetFwdBwdTracePhys(qfield[j][i], qFwd, qBwd);
516 
517  // Get Riemann flux of qflux --> LDG implies upwind
518  fields[i]->GetTrace()->Upwind(Vn, qBwd, qFwd, qfluxtemp);
519 
520  // Multiply the Riemann flux by the trace normals
521  Vmath::Vmul(nTracePts, m_traceNormals[j], 1, qfluxtemp, 1,
522  qfluxtemp, 1);
523 
524  // Impose weak boundary condition with flux
525  if (fields[0]->GetBndCondExpansions().num_elements())
526  {
527  v_WeakPenaltyO2(fields, i, j, qfield[j][i], qfluxtemp);
528  }
529 
530  // Store the final flux into qflux
531  Vmath::Vadd(nTracePts, qfluxtemp, 1, qflux[i], 1,
532  qflux[i], 1);
533  }
534  }
535  }
536 
537 
538  /**
539  * @brief Imposes appropriate bcs for the 2nd order derivatives
540  *
541  */
544  const int var,
545  const int dir,
546  const Array<OneD, const NekDouble> &qfield,
547  Array<OneD, NekDouble> &penaltyflux)
548  {
549  int cnt = 0;
550  int nBndEdges, nBndEdgePts;
551  int i, e;
552  int id2;
553 
554  int nTracePts = fields[0]->GetTrace()->GetTotPoints();
555  int nBndRegions = fields[var]->GetBndCondExpansions().num_elements();
556 
557  Array<OneD, NekDouble > uterm(nTracePts);
558  Array<OneD, NekDouble > qtemp(nTracePts);
559 
560  // Extract the physical values of the solution at the boundaries
561  fields[var]->ExtractTracePhys(qfield, qtemp);
562 
563  // Loop on the boundary regions to apply appropriate bcs
564  for (i = 0; i < nBndRegions; ++i)
565  {
566  // Number of boundary regions related to region 'i'
567  nBndEdges = fields[var]->
568  GetBndCondExpansions()[i]->GetExpSize();
569 
570  // Weakly impose bcs by modifying flux values
571  for (e = 0; e < nBndEdges; ++e)
572  {
573  nBndEdgePts = fields[var]->
574  GetBndCondExpansions()[i]->GetExp(e)->GetTotPoints();
575 
576  id2 = fields[0]->GetTrace()->
577  GetPhys_Offset(fields[0]->GetTraceMap()->
578  GetBndCondTraceToGlobalTraceMap(cnt++));
579 
580  // In case of Dirichlet bcs:
581  // uflux = gD
582  if(fields[var]->GetBndConditions()[i]->
583  GetBoundaryConditionType() == SpatialDomains::eDirichlet
584  && !boost::iequals(fields[var]->GetBndConditions()[i]->
585  GetUserDefined(), "WallAdiabatic"))
586  {
587  Vmath::Vmul(nBndEdgePts,
588  &m_traceNormals[dir][id2], 1,
589  &qtemp[id2], 1,
590  &penaltyflux[id2], 1);
591  }
592  // 3.4) In case of Neumann bcs:
593  // uflux = u+
594  else if((fields[var]->GetBndConditions()[i])->
595  GetBoundaryConditionType() == SpatialDomains::eNeumann)
596  {
597  ASSERTL0(false,
598  "Neumann bcs not implemented for LDGNS");
599 
600  /*
601  Vmath::Vmul(nBndEdgePts,
602  &m_traceNormals[dir][id2], 1,
603  &(fields[var]->
604  GetBndCondExpansions()[i]->
605  UpdatePhys())[id1], 1,
606  &penaltyflux[id2], 1);
607  */
608  }
609  else if(boost::iequals(fields[var]->GetBndConditions()[i]->
610  GetUserDefined(), "WallAdiabatic"))
611  {
612  if ((var == m_spaceDim + 1))
613  {
614  Vmath::Zero(nBndEdgePts, &penaltyflux[id2], 1);
615  }
616  else
617  {
618 
619  Vmath::Vmul(nBndEdgePts,
620  &m_traceNormals[dir][id2], 1,
621  &qtemp[id2], 1,
622  &penaltyflux[id2], 1);
623 
624  }
625  }
626  }
627  }
628  }
629  }//end of namespace SolverUtils
630 }//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:161
static DiffusionSharedPtr create(std::string diffType)
virtual void v_WeakPenaltyO2(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const int var, const int dir, const Array< OneD, const NekDouble > &qfield, Array< OneD, NekDouble > &penaltyflux)
Imposes appropriate bcs for the 2nd order derivatives.
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_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
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_WeakPenaltyO1(const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &penaltyfluxO1)
Imposes appropriate bcs for the 1st order derivatives.
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