40 #include <boost/algorithm/string.hpp>
46 "VelocityCorrectionScheme",
57 : UnsteadySystem(pSession),
77 ASSERTL0(
false,
"Need to set up pressure field definition");
83 std::string vExtrapolation =
"Standard";
85 if (
m_session->DefinesSolverInfo(
"Extrapolation"))
87 vExtrapolation =
m_session->GetSolverInfo(
"Extrapolation");
116 ASSERTL0(m_nConvectiveFields > 2,
"Expect to have three velcoity fields with homogenous expansion");
125 Array<OneD, unsigned int> planes;
128 int num_planes = planes.num_elements();
129 Array<OneD, NekDouble> SVV(num_planes,0.0);
131 int kmodes =
m_fields[0]->GetHomogeneousBasis()->GetNumModes();
136 for(n = 0; n < num_planes; ++n)
138 if(planes[n] > pstart)
140 fac = (
NekDouble)((planes[n] - kmodes)*(planes[n] - kmodes))/
141 ((
NekDouble)((planes[n] - pstart)*(planes[n] - pstart)));
146 for(
int i = 0; i <
m_velocity.num_elements(); ++i)
159 "Projection must be set to Mixed_CG_Discontinuous for "
198 dealias += (dealias ==
"" ?
"" :
" + ") +
string(
"spectral/hp");
208 smoothing += (smoothing ==
"" ?
"" :
" + ") +
string(
"Homogeneous1D");
213 s,
"Smoothing",
"SVV (" + smoothing +
" SVV (cut-off = "
248 int nfields =
m_fields.num_elements() - 1;
249 for (
int k=0 ; k < nfields; ++k)
263 int nfields =
m_fields.num_elements() - 1;
264 for (
int k=0 ; k < nfields; ++k)
276 int vVar =
m_session->GetVariables().size();
277 Array<OneD, bool> vChecks(vVar,
false);
278 vChecks[vVar-1] =
true;
287 return m_session->GetVariables().size() - 1;
294 const Array<
OneD,
const Array<OneD, NekDouble> > &inarray,
295 Array<
OneD, Array<OneD, NekDouble> > &outarray,
310 std::vector<SolverUtils::ForcingSharedPtr>::const_iterator x;
313 (*x)->Apply(
m_fields, inarray, outarray, time);
324 const Array<
OneD,
const Array<OneD, NekDouble> > &inarray,
325 Array<
OneD, Array<OneD, NekDouble> > &outarray,
330 int phystot =
m_fields[0]->GetTotPoints();
337 F[i] = Array<OneD, NekDouble> (phystot);
376 const Array<
OneD,
const Array<OneD, NekDouble> > &fields,
377 Array<
OneD, Array<OneD, NekDouble> > &Forcing,
381 int physTot =
m_fields[0]->GetTotPoints();
383 Array<OneD, NekDouble> wk(physTot, 0.0);
387 for(i = 0; i < nvel; ++i)
390 Vmath::Vadd(physTot,wk,1,Forcing[0],1,Forcing[0],1);
392 Vmath::Smul(physTot,1.0/aii_Dt,Forcing[0],1,Forcing[0],1);
399 const Array<
OneD,
const Array<OneD, NekDouble> > &inarray,
400 Array<
OneD, Array<OneD, NekDouble> > &Forcing,
404 int phystot =
m_fields[0]->GetTotPoints();
422 for(
int i = 0; i < nvel; ++i)
424 Blas::Daxpy(phystot,-aii_dtinv,inarray[i],1,Forcing[i],1);
425 Blas::Dscal(phystot,1.0/
m_kinvis,&(Forcing[i])[0],1);