52 NavierStokesAdvection::NavierStokesAdvection():
76 pSession->MatchSolverInfo(
"ModeType",
"SingleMode",
m_SingleMode,
false);
77 pSession->MatchSolverInfo(
"ModeType",
"HalfMode",
m_HalfMode,
false);
84 const int nConvectiveFields,
91 int nqtot = fields[0]->GetTotPoints();
92 ASSERTL1(nConvectiveFields == inarray.num_elements(),
"Number of convective fields and Inarray are not compatible");
96 for(
int n = 0; n < nConvectiveFields; ++n)
99 int ndim = advVel.num_elements();
104 int nPointsTot = fields[0]->GetNpoints();
112 nPointsTot = fields[0]->Get1DScaledTotPoints(OneDptscale);
118 int nadv = advVel.num_elements();
122 for(
int i = 0; i < nadv; ++i)
126 AdvVel[i] = AdvVel[i-1]+nPointsTot;
129 fields[0]->PhysInterp1DScaled(OneDptscale,advVel[i],AdvVel[i]);
132 Outarray = AdvVel[nadv-1] + nPointsTot;
136 for(
int i = 0; i < nadv; ++i)
138 AdvVel[i] = advVel[i];
141 Outarray = outarray[n];
151 fields[0]->PhysDeriv(inarray[n],grad0);
152 Vmath::Vmul(nPointsTot,grad0,1,advVel[0],1,outarray[n],1);
157 fields[0]->PhysDeriv(inarray[n],grad0,grad1);
161 fields[0]->PhysInterp1DScaled(OneDptscale,grad0,wkSp);
163 fields[0]->PhysInterp1DScaled(OneDptscale,grad1,wkSp);
167 Vmath::Vmul (nPointsTot,grad0,1,AdvVel[0],1,Outarray,1);
168 Vmath::Vvtvp(nPointsTot,grad1,1,AdvVel[1],1,Outarray,1,Outarray,1);
172 fields[0]->PhysGalerkinProjection1DScaled(OneDptscale,Outarray,outarray[n]);
185 fields[0]->PhysDeriv(inarray[n],grad0,grad1,grad2);
187 fields[0]->DealiasedProd(advVel[0],grad0,grad0,
m_CoeffState);
188 fields[0]->DealiasedProd(advVel[1],grad1,grad1,
m_CoeffState);
189 fields[0]->DealiasedProd(advVel[2],grad2,grad2,
m_CoeffState);
190 Vmath::Vadd(nPointsTot,grad0,1,grad1,1,outarray[n],1);
191 Vmath::Vadd(nPointsTot,grad2,1,outarray[n],1,outarray[n],1);
196 fields[0]->PhysDeriv(advVel[n],grad0,grad1);
201 fields[0]->HomogeneousBwdTrans(outarray[n],grad2);
205 fields[0]->PhysInterp1DScaled(OneDptscale,grad0,wkSp);
206 Vmath::Vmul(nPointsTot,wkSp,1,AdvVel[0],1,Outarray,1);
210 Vmath::Vmul(nPointsTot,grad0,1,AdvVel[0],1,Outarray,1);
215 fields[0]->PhysInterp1DScaled(OneDptscale,grad1,wkSp);
227 fields[0]->PhysInterp1DScaled(OneDptscale,grad2,wkSp);
228 Vmath::Vvtvp(nPointsTot,wkSp,1,AdvVel[2],1,Outarray,1,Outarray,1);
229 fields[0]->PhysGalerkinProjection1DScaled(OneDptscale,Outarray,grad2);
230 fields[0]->HomogeneousFwdTrans(grad2,outarray[n]);
234 Vmath::Vvtvp(nPointsTot,grad2,1,AdvVel[2],1,Outarray,1,grad0,1);
235 fields[0]->HomogeneousFwdTrans(grad0,outarray[n]);
241 fields[0]->PhysDeriv(inarray[n],grad0,grad1,grad2);
245 fields[0]->PhysInterp1DScaled(OneDptscale,grad0,wkSp);
246 Vmath::Vmul(nPointsTot,wkSp,1,AdvVel[0],1,Outarray,1);
250 Vmath::Vmul(nPointsTot,grad0,1,AdvVel[0],1,Outarray,1);
256 fields[0]->PhysInterp1DScaled(OneDptscale,grad1,wkSp);
268 fields[0]->PhysInterp1DScaled(OneDptscale,grad2,wkSp);
269 Vmath::Vvtvp(nPointsTot,wkSp,1,AdvVel[2],1,Outarray,1,Outarray,1);
270 fields[0]->PhysGalerkinProjection1DScaled(OneDptscale,Outarray,outarray[n]);
274 Vmath::Vvtvp(nPointsTot,grad2,1,AdvVel[2],1,Outarray,1,outarray[n],1);
281 fields[0]->PhysDeriv(inarray[n],grad0,grad1,grad2);
283 fields[0]->HomogeneousBwdTrans(grad0, outarray[n]);
284 fields[0]->DealiasedProd(advVel[0], outarray[n], grad0,
287 fields[0]->HomogeneousBwdTrans(grad1,outarray[n]);
288 fields[0]->DealiasedProd(advVel[1], outarray[n], grad1,
291 fields[0]->HomogeneousBwdTrans(grad2,outarray[n]);
292 fields[0]->DealiasedProd(advVel[2], outarray[n], grad2,
295 Vmath::Vadd(nPointsTot, grad0, 1, grad1, 1, grad0, 1);
296 Vmath::Vadd(nPointsTot, grad0, 1, grad2, 1, grad0, 1);
298 fields[0]->HomogeneousFwdTrans(grad0,outarray[n]);
302 ASSERTL0(
false,
"Advection term calculation not implented or "
303 "possible with the current problem set up");
307 ASSERTL0(
false,
"dimension unknown");
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)
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...
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
virtual SOLVER_UTILS_EXPORT void v_InitObject(LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)
Initialises the advection object.
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.
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.