59 std::vector<std::string> vel;
74 ASSERTL0(
false,
"Implicit unsteady Advection not set up.");
83 const Array<
OneD,
const Array<OneD, NekDouble> >&inarray,
84 Array<
OneD, Array<OneD, NekDouble> >&outarray,
88 int nvariables = inarray.num_elements();
95 int ncoeffs = inarray[0].num_elements();
96 Array<OneD, Array<OneD, NekDouble> > WeakAdv(nvariables);
98 WeakAdv[0] = Array<OneD, NekDouble>(ncoeffs*nvariables);
99 for(j = 1; j < nvariables; ++j)
101 WeakAdv[j] = WeakAdv[j-1] + ncoeffs;
106 for(j = 0; j < nvariables; ++j)
108 m_fields[j]->MultiplyByElmtInvMass(WeakAdv[j], WeakAdv[j]);
109 m_fields[j]->BwdTrans(WeakAdv[j],outarray[j]);
118 for(j = 0; j < nvariables; ++j)
132 const Array<
OneD,
const Array<OneD, NekDouble> >&inarray,
133 Array<
OneD, Array<OneD, NekDouble> >&outarray,
137 int nvariables = inarray.num_elements();
147 for(j = 0; j < nvariables; ++j)
158 for(j = 0; j < nvariables; ++j)
160 m_fields[j]->FwdTrans(inarray[j],coeffs);
161 m_fields[j]->BwdTrans_IterPerExp(coeffs,outarray[j]);
166 ASSERTL0(
false,
"Unknown projection scheme");
174 Array<
OneD, Array<OneD, NekDouble> > &physfield,
175 Array<
OneD, Array<OneD, NekDouble> > &flux)
178 "Dimension of flux array and velocity array do not match");
180 for (
int j = 0; j < flux.num_elements(); ++j)
190 Array<
OneD, Array<OneD, NekDouble> > &physfield,
191 Array<
OneD, Array<OneD, NekDouble> > &numflux)
197 Array<OneD, NekDouble > Fwd(nTraceNumPoints);
198 Array<OneD, NekDouble > Bwd(nTraceNumPoints);
199 Array<OneD, NekDouble > Vn (nTraceNumPoints,0.0);
202 for (i = 0; i < nvel; ++i)
207 Fwd, 1, Vn, 1, Vn, 1);
210 for (i = 0; i < numflux.num_elements(); ++i)
212 m_fields[i]->GetFwdBwdTracePhys(physfield[i], Fwd, Bwd);
214 m_fields[i]->GetTrace()->Upwind(Vn, Fwd, Bwd, numflux[i]);
216 Vmath::Vmul(nTraceNumPoints, numflux[i], 1, Vn, 1, numflux[i], 1);
230 const Array<OneD,int> ExpOrder,
231 const Array<OneD,NekDouble> CFL,
235 int n_element =
m_fields[0]->GetExpSize();
241 Array<OneD, NekDouble> tstep (n_element, 0.0);
242 Array<OneD, NekDouble> stdVelocity(n_element, 0.0);
245 for (
int el = 0; el < n_element; ++el)
247 int npoints =
m_fields[0]->GetExp(el)->GetTotPoints();
248 Array<OneD, NekDouble> one2D(npoints, 1.0);
250 if(boost::dynamic_pointer_cast<LocalRegions::TriExp>(
m_fields[0]->GetExp(el)))
254 tstep[el] = CFL[el]/(stdVelocity[el]);
256 else if(boost::dynamic_pointer_cast<LocalRegions::QuadExp>(
m_fields[0]->GetExp(el)))
260 tstep[el] = CFL[el]/(stdVelocity[el]);
284 int n_elements =
m_fields[0]->GetExpSize();
301 if (TimeStability == 1.0)
305 else if (TimeStability == 2.0)
309 else if (TimeStability == 2.784)
315 ASSERTL0(
false,
"Dominant eigenvalues database not present for this time-stepping scheme")
320 TimeStep = (TimeStability/SpatialStability)*CFL;
330 const Array<
OneD, Array<OneD,NekDouble> > inarray)
336 int n_element =
m_fields[0]->GetExpSize();
337 int nvel = inarray.num_elements();
342 Array<OneD, Array<OneD, NekDouble> > stdVelocity(nvel);
343 Array<OneD, NekDouble> stdV(n_element, 0.0);
345 for (
int i = 0; i < nvel; ++i)
347 stdVelocity[i] = Array<OneD, NekDouble>(nTotQuadPoints);
352 for (
int el = 0; el < n_element; ++el)
358 Array<OneD, const NekDouble> jac =
359 el2D->GetGeom2D()->GetMetricInfo()->GetJac();
360 Array<TwoD, const NekDouble> gmat =
361 el2D->GetGeom2D()->GetMetricInfo()->GetDerivFactors();
363 if (el2D->GetGeom2D()->GetMetricInfo()->GetGtype()
366 for (
int i = 0; i < n_points; i++)
368 stdVelocity[0][i] = gmat[0][i]*inarray[0][i]
369 + gmat[2][i]*inarray[1][i];
371 stdVelocity[1][i] = gmat[1][i]*inarray[0][i]
372 + gmat[3][i]*inarray[1][i];
377 for (
int i = 0; i < n_points; i++)
379 stdVelocity[0][i] = gmat[0][0]*inarray[0][i]
380 + gmat[2][0]*inarray[1][i];
382 stdVelocity[1][i] = gmat[1][0]*inarray[0][i]
383 + gmat[3][0]*inarray[1][i];
388 for (
int i = 0; i < n_points; i++)
390 pntVelocity = sqrt(stdVelocity[0][i]*stdVelocity[0][i]
391 + stdVelocity[1][i]*stdVelocity[1][i]);
393 if (pntVelocity>stdV[el])
395 stdV[el] = pntVelocity;
402 for (
int el = 0; el < n_element; ++el)
409 Array<OneD, const NekDouble> jac =
410 el3D->GetGeom3D()->GetMetricInfo()->GetJac();
411 Array<TwoD, const NekDouble> gmat =
412 el3D->GetGeom3D()->GetMetricInfo()->GetDerivFactors();
414 if (el3D->GetGeom3D()->GetMetricInfo()->GetGtype()
417 for (
int i = 0; i < n_points; i++)
419 stdVelocity[0][i] = gmat[0][i]*inarray[0][i]
420 + gmat[3][i]*inarray[1][i]
421 + gmat[6][i]*inarray[2][i];
423 stdVelocity[1][i] = gmat[1][i]*inarray[0][i]
424 + gmat[4][i]*inarray[1][i]
425 + gmat[7][i]*inarray[2][i];
427 stdVelocity[2][i] = gmat[2][i]*inarray[0][i]
428 + gmat[5][i]*inarray[1][i]
429 + gmat[8][i]*inarray[2][i];
434 Array<OneD, const NekDouble> jac =
435 el3D->GetGeom3D()->GetMetricInfo()->GetJac();
436 Array<TwoD, const NekDouble> gmat =
437 el3D->GetGeom3D()->GetMetricInfo()->GetDerivFactors();
439 for (
int i = 0; i < n_points; i++)
441 stdVelocity[0][i] = gmat[0][0]*inarray[0][i]
442 + gmat[3][0]*inarray[1][i]
443 + gmat[6][0]*inarray[2][i];
445 stdVelocity[1][i] = gmat[1][0]*inarray[0][i]
446 + gmat[4][0]*inarray[1][i]
447 + gmat[7][0]*inarray[2][i];
449 stdVelocity[2][i] = gmat[2][0]*inarray[0][i]
450 + gmat[5][0]*inarray[1][i]
451 + gmat[8][0]*inarray[2][i];
455 for (
int i = 0; i < n_points; i++)
457 pntVelocity = sqrt(stdVelocity[0][i]*stdVelocity[0][i]
458 + stdVelocity[1][i]*stdVelocity[1][i]
459 + stdVelocity[2][i]*stdVelocity[2][i]);
461 if (pntVelocity > stdV[el])
463 stdV[el] = pntVelocity;