55 Array<OneD, MultiRegions::ExpListSharedPtr> pFields)
64 m_session->LoadParameter (
"thermalConductivity",
71 int nDim = pFields[0]->GetCoordim(0);
72 int nTracePts = pFields[0]->GetTrace()->GetTotPoints();
75 if (pSession->DefinesSolverInfo(
"HOMOGENEOUS"))
86 m_traceVel[i] = Array<OneD, NekDouble> (nTracePts, 0.0);
87 m_traceNormals[i] = Array<OneD, NekDouble> (nTracePts);
89 pFields[0]->GetTrace()->GetNormals(m_traceNormals);
106 const int nConvectiveFields,
107 const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
108 const Array<
OneD, Array<OneD, NekDouble> > &inarray,
109 Array<
OneD, Array<OneD, NekDouble> > &outarray)
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();
118 Array<OneD, NekDouble> tmp1(nCoeffs);
119 Array<OneD, Array<OneD, NekDouble> > tmp2(nConvectiveFields);
121 Array<OneD, Array<OneD, Array<OneD, NekDouble> > >
123 Array<OneD, Array<OneD, Array<OneD, NekDouble> > >
126 Array<OneD, Array<OneD, NekDouble> > fluxvector(
m_spaceDim);
130 numericalFluxO1[j] = Array<OneD, Array<OneD, NekDouble> >(
132 derivativesO1[j] = Array<OneD, Array<OneD, NekDouble> >(
135 for (i = 0; i < nScalars; ++i)
137 numericalFluxO1[j][i] = Array<OneD, NekDouble>(
139 derivativesO1[j][i] = Array<OneD, NekDouble>(nPts, 0.0);
146 for (j = 0; j < nDim; ++j)
148 for (i = 0; i < nScalars; ++i)
150 fields[i]->IProductWRTDerivBase (j, inarray[i], tmp1);
152 fields[i]->AddTraceIntegral (numericalFluxO1[j][i],
154 fields[i]->SetPhysState (
false);
155 fields[i]->MultiplyByElmtInvMass(tmp1, tmp1);
156 fields[i]->BwdTrans (tmp1, derivativesO1[j][i]);
163 for (i = 0; i < nScalars; ++i)
170 m_viscTensor = Array<OneD, Array<OneD, Array<OneD, NekDouble> > >
172 Array<OneD, Array<OneD, NekDouble> > viscousFlux(nConvectiveFields);
178 for (i = 0; i < nScalars+1; ++i)
184 for (i = 0; i < nConvectiveFields; ++i)
186 viscousFlux[i] = Array<OneD, NekDouble>(nTracePts, 0.0);
195 for (i = 0; i < nConvectiveFields; ++i)
197 tmp2[i] = Array<OneD, NekDouble>(nCoeffs, 0.0);
199 for (j = 0; j < nDim; ++j)
201 fields[i]->IProductWRTDerivBase(j,
m_viscTensor[j][i], tmp1);
202 Vmath::Vadd(nCoeffs, tmp1, 1, tmp2[i], 1, 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]);
219 const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
220 const Array<
OneD, Array<OneD, NekDouble> > &inarray,
221 Array<
OneD, Array<
OneD, Array<OneD, NekDouble> > >
225 int nTracePts = fields[0]->GetTrace()->GetTotPoints();
226 int nScalars = inarray.num_elements();
227 int nDim = fields[0]->GetCoordim(0);
229 Array<OneD, NekDouble > Vn (nTracePts, 0.0);
230 Array<OneD, NekDouble > fluxtemp(nTracePts, 0.0);
233 for(i = 0; i < nDim; ++i)
240 Array<OneD, Array<OneD, NekDouble> > Fwd (nScalars);
241 Array<OneD, Array<OneD, NekDouble> > Bwd (nScalars);
242 Array<OneD, Array<OneD, NekDouble> > numflux(nScalars);
244 for (i = 0; i < nScalars; ++i)
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]);
254 if (fields[0]->GetBndCondExpansions().num_elements())
262 for (i = 0; i < nScalars; ++i)
265 numflux[i], 1, numericalFluxO1[j][i], 1);
275 const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
276 const Array<
OneD, Array<OneD, NekDouble> > &inarray,
277 Array<
OneD, Array<OneD, NekDouble> > &penaltyfluxO1)
283 int nBndEdgePts, nBndEdges, nBndRegions;
285 int nTracePts = fields[0]->GetTrace()->GetTotPoints();
286 int nScalars = inarray.num_elements();
288 Array<OneD, NekDouble> tmp1(nTracePts, 0.0);
289 Array<OneD, NekDouble> tmp2(nTracePts, 0.0);
290 Array<OneD, NekDouble> Tw(nTracePts,
m_Twall);
292 Array< OneD, Array<OneD, NekDouble > > scalarVariables(nScalars);
293 Array< OneD, Array<OneD, NekDouble > > uplus(nScalars);
296 for (i = 0; i < nScalars; ++i)
298 scalarVariables[i] = Array<OneD, NekDouble>(nTracePts, 0.0);
300 uplus[i] = Array<OneD, NekDouble>(nTracePts, 0.0);
301 fields[i]->ExtractTracePhys(inarray[i], uplus[i]);
305 for (i = 0; i < nScalars-1; ++i)
310 nBndRegions = fields[i+1]->
311 GetBndCondExpansions().num_elements();
312 for (j = 0; j < nBndRegions; ++j)
314 nBndEdges = fields[i+1]->
315 GetBndCondExpansions()[j]->GetExpSize();
316 for (e = 0; e < nBndEdges; ++e)
318 nBndEdgePts = fields[i+1]->
319 GetBndCondExpansions()[j]->GetExp(e)->GetTotPoints();
322 GetBndCondExpansions()[j]->GetPhys_Offset(e);
324 id2 = fields[0]->GetTrace()->
325 GetPhys_Offset(fields[0]->GetTraceMap()->
326 GetBndCondTraceToGlobalTraceMap(cnt++));
329 if (fields[i]->GetBndConditions()[j]->
334 &scalarVariables[i][id2], 1);
338 else if (fields[i]->GetBndConditions()[j]->
339 GetBoundaryConditionType() ==
343 &(fields[i+1]->GetBndCondExpansions()[j]->
344 UpdatePhys())[id1], 1,
345 &(fields[0]->GetBndCondExpansions()[j]->
346 UpdatePhys())[id1], 1,
347 &scalarVariables[i][id2], 1);
351 if (fields[i]->GetBndConditions()[j]->
352 GetBoundaryConditionType() ==
356 &scalarVariables[i][id2], 1,
357 &penaltyfluxO1[i][id2], 1);
361 else if ((fields[i]->GetBndConditions()[j])->
362 GetBoundaryConditionType() ==
367 &penaltyfluxO1[i][id2], 1);
372 &scalarVariables[i][id2], 1,
373 &scalarVariables[i][id2], 1,
390 nBndRegions = fields[nScalars]->
391 GetBndCondExpansions().num_elements();
392 for (j = 0; j < nBndRegions; ++j)
394 nBndEdges = fields[nScalars]->
395 GetBndCondExpansions()[j]->GetExpSize();
396 for (e = 0; e < nBndEdges; ++e)
398 nBndEdgePts = fields[nScalars]->
399 GetBndCondExpansions()[j]->GetExp(e)->GetTotPoints();
401 id1 = fields[nScalars]->
402 GetBndCondExpansions()[j]->GetPhys_Offset(e);
404 id2 = fields[0]->GetTrace()->
405 GetPhys_Offset(fields[0]->GetTraceMap()->
406 GetBndCondTraceToGlobalTraceMap(cnt++));
409 if (fields[i]->GetBndConditions()[j]->
415 &scalarVariables[nScalars-1][id2], 1);
419 else if (fields[i]->GetBndConditions()[j]->
420 GetBoundaryConditionType() ==
426 GetBndCondExpansions()[j]->
429 GetBndCondExpansions()[j]->
431 &scalarVariables[nScalars-1][id2], 1);
435 &scalarVariables[nScalars-1][id2], 1,
437 &scalarVariables[nScalars-1][id2], 1);
441 &scalarVariables[nScalars-1][id2], 1,
442 &scalarVariables[nScalars-1][id2], 1);
446 if (fields[nScalars]->GetBndConditions()[j]->
447 GetBoundaryConditionType() ==
451 &scalarVariables[nScalars-1][id2], 1,
452 &penaltyfluxO1[nScalars-1][id2], 1);
456 else if ((fields[nScalars]->GetBndConditions()[j])->
457 GetBoundaryConditionType() ==
461 &uplus[nScalars-1][id2], 1,
462 &penaltyfluxO1[nScalars-1][id2], 1);
473 const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
474 const Array<
OneD, Array<OneD, NekDouble> > &ufield,
475 Array<
OneD, Array<
OneD, Array<OneD, NekDouble> > > &qfield,
476 Array<
OneD, Array<OneD, NekDouble> > &qflux)
479 int nTracePts = fields[0]->GetTrace()->GetTotPoints();
480 int nVariables = fields.num_elements();
481 int nDim = fields[0]->GetCoordim(0);
483 Array<OneD, NekDouble > Fwd(nTracePts);
484 Array<OneD, NekDouble > Bwd(nTracePts);
485 Array<OneD, NekDouble > Vn (nTracePts, 0.0);
487 Array<OneD, NekDouble > qFwd (nTracePts);
488 Array<OneD, NekDouble > qBwd (nTracePts);
489 Array<OneD, NekDouble > qfluxtemp(nTracePts, 0.0);
492 for(i = 0; i < nDim; ++i)
501 for (i = 1; i < nVariables; ++i)
503 qflux[i] = Array<OneD, NekDouble> (nTracePts, 0.0);
504 for (j = 0; j < nDim; ++j)
507 fields[i]->GetFwdBwdTracePhys(qfield[j][i], qFwd, qBwd);
510 fields[i]->GetTrace()->Upwind(Vn, qBwd, qFwd, qfluxtemp);
517 if (fields[0]->GetBndCondExpansions().num_elements())
535 const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
538 const Array<OneD, const NekDouble> &qfield,
539 Array<OneD, NekDouble> &penaltyflux)
542 int nBndEdges, nBndEdgePts;
546 int nTracePts = fields[0]->GetTrace()->GetTotPoints();
547 int nBndRegions = fields[var]->GetBndCondExpansions().num_elements();
549 Array<OneD, NekDouble > uterm(nTracePts);
550 Array<OneD, NekDouble > qtemp(nTracePts);
553 fields[var]->ExtractTracePhys(qfield, qtemp);
556 for (i = 0; i < nBndRegions; ++i)
559 nBndEdges = fields[var]->
560 GetBndCondExpansions()[i]->GetExpSize();
563 for (e = 0; e < nBndEdges; ++e)
565 nBndEdgePts = fields[var]->
566 GetBndCondExpansions()[i]->GetExp(e)->GetTotPoints();
568 id2 = fields[0]->GetTrace()->
569 GetPhys_Offset(fields[0]->GetTraceMap()->
570 GetBndCondTraceToGlobalTraceMap(cnt++));
574 if(fields[var]->GetBndConditions()[i]->
580 &penaltyflux[id2], 1);
584 else if((fields[var]->GetBndConditions()[i])->
588 "Neumann bcs not implemented for LDGNS");