52 NavierStokesAdvection::NavierStokesAdvection():
76 pSession->MatchSolverInfo(
"ModeType",
"SingleMode",
m_SingleMode,
false);
77 pSession->MatchSolverInfo(
"ModeType",
"HalfMode",
m_HalfMode,
false);
84 const int nConvectiveFields,
93 int nqtot = fields[0]->GetTotPoints();
94 ASSERTL1(nConvectiveFields == inarray.num_elements(),
"Number of convective fields and Inarray are not compatible");
97 int ndim = advVel.num_elements();
101 for(
int i = 0; i < ndim; ++i)
107 fields[i]->HomogeneousBwdTrans(advVel[i],velocity[i]);
111 velocity[i] = advVel[i];
115 int nPointsTot = fields[0]->GetNpoints();
123 nPointsTot = fields[0]->Get1DScaledTotPoints(OneDptscale);
129 for(
int i = 0; i < ndim; ++i)
133 fields[0]->PhysInterp1DScaled(OneDptscale,velocity[i],AdvVel[i]);
138 for(
int i = 0; i < ndim; ++i)
140 AdvVel[i] = velocity[i];
151 for(
int n = 0; n < nConvectiveFields; ++n)
153 fields[0]->PhysDeriv(inarray[n],grad0);
157 fields[0]->PhysInterp1DScaled(OneDptscale,grad0,wkSp);
158 Vmath::Vmul (nPointsTot,wkSp,1,AdvVel[0],1,Outarray,1);
160 fields[0]->PhysGalerkinProjection1DScaled(OneDptscale,Outarray,outarray[n]);
164 Vmath::Vmul(nPointsTot,grad0,1,AdvVel[0],1,outarray[n],1);
171 for(
int n = 0; n < nConvectiveFields; ++n)
173 fields[0]->PhysDeriv(inarray[n],grad0,grad1);
178 fields[0]->PhysInterp1DScaled(OneDptscale,grad0,wkSp);
179 Vmath::Vmul (nPointsTot,wkSp,1,AdvVel[0],1,Outarray,1);
180 fields[0]->PhysInterp1DScaled(OneDptscale,grad1,wkSp);
181 Vmath::Vvtvp(nPointsTot,wkSp,1,AdvVel[1],1,Outarray,1,Outarray,1);
183 fields[0]->PhysGalerkinProjection1DScaled(OneDptscale,Outarray,outarray[n]);
187 Vmath::Vmul (nPointsTot,grad0,1,AdvVel[0],1,outarray[n],1);
188 Vmath::Vvtvp(nPointsTot,grad1,1,AdvVel[1],1,outarray[n],1,outarray[n],1);
198 for (
int i = 0; i < ndim; i++)
202 for (
int i = 0; i < ndim*nConvectiveFields; i++)
206 for (
int i = 0; i < nConvectiveFields; i++)
211 for (
int n = 0; n < nConvectiveFields; n++)
213 fields[0]->PhysDeriv(inarray[n],grad[0],grad[1],grad[2]);
214 for (
int i = 0; i < ndim; i++)
216 fields[0]->PhysInterp1DScaled(OneDptscale,grad[i],
217 gradScaled[n*ndim+i]);
221 fields[0]->DealiasedDotProd(AdvVel,gradScaled,Outarray,
m_CoeffState);
223 for (
int n = 0; n < nConvectiveFields; n++)
225 fields[0]->PhysGalerkinProjection1DScaled(OneDptscale,
226 Outarray[n],outarray[n]);
233 for (
int i = 0; i < ndim*nConvectiveFields; i++)
237 for (
int i = 0; i < nConvectiveFields; i++)
242 for (
int n = 0; n < nConvectiveFields; n++)
244 fields[0]->PhysDeriv(inarray[n],grad[n*ndim+0],
249 fields[0]->DealiasedDotProd(AdvVel,grad,outarray,
m_CoeffState);
256 for(
int n = 0; n < nConvectiveFields; ++n)
258 if (fields[0]->GetWaveSpace() ==
true &&
264 fields[0]->PhysDeriv(velocity[n],grad0,grad1);
268 fields[0]->HomogeneousBwdTrans(inarray[n],wkSp);
269 fields[0]->PhysDeriv(wkSp,grad0,grad1);
275 fields[0]->HomogeneousBwdTrans(outarray[n],grad2);
277 else if (fields[0]->GetWaveSpace() ==
true &&
283 fields[0]->PhysDeriv(velocity[n],grad0);
287 fields[0]->HomogeneousBwdTrans(inarray[n],wkSp);
288 fields[0]->PhysDeriv(wkSp,grad0);
293 fields[0]->HomogeneousBwdTrans(outarray[n],grad1);
297 fields[0]->HomogeneousBwdTrans(outarray[n],grad2);
301 fields[0]->PhysDeriv(inarray[n],grad0,grad1,grad2);
306 fields[0]->PhysInterp1DScaled(OneDptscale,grad0,wkSp);
307 Vmath::Vmul(nPointsTot,wkSp,1,AdvVel[0],1,Outarray,1);
309 fields[0]->PhysInterp1DScaled(OneDptscale,grad1,wkSp);
313 fields[0]->PhysInterp1DScaled(OneDptscale,grad2,wkSp);
316 fields[0]->PhysGalerkinProjection1DScaled(OneDptscale,
317 Outarray,outarray[n]);
321 Vmath::Vmul(nPointsTot,grad0,1,AdvVel[0],1,outarray[n],1);
322 Vmath::Vvtvp(nPointsTot,grad1,1,AdvVel[1],1,outarray[n],1,
324 Vmath::Vvtvp(nPointsTot,grad2,1,AdvVel[2],1,outarray[n],1,
328 if(fields[0]->GetWaveSpace() ==
true)
330 fields[0]->HomogeneousFwdTrans(outarray[n],outarray[n]);
336 ASSERTL0(
false,
"dimension unknown");
339 for(
int n = 0; n < nConvectiveFields; ++n)
bool m_homogen_dealiasing
#define ASSERTL0(condition, msg)
virtual void v_Advect(const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &advVel, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble &time, const Array< OneD, Array< OneD, NekDouble > > &pFwd=NullNekDoubleArrayofArray, const Array< OneD, Array< OneD, NekDouble > > &pBwd=NullNekDoubleArrayofArray)
Advects a vector field.
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
AdvectionFactory & GetAdvectionFactory()
Gets the factory for initialising advection objects.
void Neg(int n, T *x, const int incx)
Negate x = -x.
MultiRegions::CoeffState m_CoeffState
virtual ~NavierStokesAdvection()
MultiRegions::Direction const DirCartesianMap[]
virtual void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Initialises the advection object.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
virtual SOLVER_UTILS_EXPORT void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Initialises the advection object.
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.
Defines a callback function which evaluates the flux vector.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.