Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Friends | List of all members
Nektar::NavierStokesAdvection Class Reference

#include <NavierStokesAdvection.h>

Inheritance diagram for Nektar::NavierStokesAdvection:
Inheritance graph
[legend]
Collaboration diagram for Nektar::NavierStokesAdvection:
Collaboration graph
[legend]

Static Public Member Functions

static AdvectionTermSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Creates an instance of this class.

Static Public Attributes

static std::string className = GetAdvectionTermFactory().RegisterCreatorFunction("Convective", NavierStokesAdvection::create)
 Name of class.
static std::string className2 = GetAdvectionTermFactory().RegisterCreatorFunction("NonConservative", NavierStokesAdvection::create)

Protected Member Functions

 NavierStokesAdvection (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
virtual ~NavierStokesAdvection ()
- Protected Member Functions inherited from Nektar::AdvectionTerm
 AdvectionTerm (const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
 Constructor.
virtual void v_InitObject ()
virtual void v_ComputeAdvectionTerm (Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, Array< OneD, NekDouble > > &pV, const Array< OneD, const NekDouble > &pU, Array< OneD, NekDouble > &pOutarray, int pVelocityComponent, NekDouble m_time, Array< OneD, NekDouble > &pWk)

Private Member Functions

virtual void v_ComputeAdvectionTerm (Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, Array< OneD, NekDouble > > &pV, const Array< OneD, const NekDouble > &pU, Array< OneD, NekDouble > &pOutarray, int pVelocityComponent, NekDouble m_time, Array< OneD, NekDouble > &pWk)

Friends

class MemoryManager< NavierStokesAdvection >

Additional Inherited Members

- Public Member Functions inherited from Nektar::AdvectionTerm
virtual ~AdvectionTerm ()
 Destructor.
void InitObject ()
void DoAdvection (Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const int nConvectiveFields, const Array< OneD, int > &vel_loc, const Array< OneD, const Array< OneD, NekDouble > > &pInarray, Array< OneD, Array< OneD, NekDouble > > &pOutarray, NekDouble m_time, Array< OneD, NekDouble > &pWk=NullNekDouble1DArray)
 Compute advection term.
void DoAdvection (Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const Array< OneD, const Array< OneD, NekDouble > > &Velocity, const Array< OneD, const Array< OneD, NekDouble > > &pInarray, Array< OneD, Array< OneD, NekDouble > > &pOutarray, NekDouble m_time, Array< OneD, NekDouble > &pWk=NullNekDouble1DArray)
bool GetSpecHPDealiasing (void)
void SetSpecHPDealiasing (bool value)
- Protected Attributes inherited from Nektar::AdvectionTerm
LibUtilities::SessionReaderSharedPtr m_session
std::string m_sessionName
 Name of the session.
SpatialDomains::MeshGraphSharedPtr m_graph
 Pointer to mesh graph.
bool m_homogen_dealiasing
 flag to determine if use Fourier dealising or not
bool m_specHP_dealiasing
 flag to determine if use Spectral/hp element dealising or not
bool m_SingleMode
 Flag to determine if use single mode or not.
bool m_HalfMode
 Flag to determine if use half mode or not.
MultiRegions::CoeffState m_CoeffState
enum MultiRegions::ProjectionType m_projectionType
 Type of projection, i.e. Galerkin or DG.
int m_spacedim
 Spatial dimension (> expansion dim)
int m_expdim
 Dimension of the expansion.
int nvariables
 Number of variables.
int m_nConvectiveFields
int m_slices
 Number of fields to be convected;.
NekDouble m_period
Array< OneD, Array< OneD,
NekDouble > > 
m_interp
LibUtilities::NektarFFTSharedPtr m_FFT
Array< OneD, NekDoublem_tmpIN
Array< OneD, NekDoublem_tmpOUT
bool m_useFFTW

Detailed Description

Definition at line 52 of file NavierStokesAdvection.h.

Constructor & Destructor Documentation

Nektar::NavierStokesAdvection::NavierStokesAdvection ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr pGraph 
)
protected

Constructor. Creates ...

Parameters
\param

Definition at line 50 of file NavierStokesAdvection.cpp.

:
AdvectionTerm(pSession, pGraph)
{
}
Nektar::NavierStokesAdvection::~NavierStokesAdvection ( )
protectedvirtual

Definition at line 59 of file NavierStokesAdvection.cpp.

{
}

Member Function Documentation

static AdvectionTermSharedPtr Nektar::NavierStokesAdvection::create ( const LibUtilities::SessionReaderSharedPtr pSession,
const SpatialDomains::MeshGraphSharedPtr pGraph 
)
inlinestatic

Creates an instance of this class.

Definition at line 59 of file NavierStokesAdvection.h.

{
p->InitObject();
return p;
}
void Nektar::NavierStokesAdvection::v_ComputeAdvectionTerm ( Array< OneD, MultiRegions::ExpListSharedPtr > &  pFields,
const Array< OneD, Array< OneD, NekDouble > > &  pV,
const Array< OneD, const NekDouble > &  pU,
Array< OneD, NekDouble > &  pOutarray,
int  pVelocityComponent,
NekDouble  m_time,
Array< OneD, NekDouble > &  pWk 
)
privatevirtual

Definition at line 67 of file NavierStokesAdvection.cpp.

References ASSERTL0, Nektar::MultiRegions::DirCartesianMap, Nektar::AdvectionTerm::m_CoeffState, Nektar::AdvectionTerm::m_homogen_dealiasing, Nektar::AdvectionTerm::m_specHP_dealiasing, Vmath::Vadd(), Vmath::Vcopy(), Vmath::Vmul(), and Vmath::Vvtvp().

{
// use dimension of Velocity vector to dictate dimension of operation
int ndim = pV.num_elements();
Array<OneD, Array<OneD, NekDouble> > AdvVel (pV.num_elements());
Array<OneD, NekDouble> Outarray;
int nPointsTot = pFields[0]->GetNpoints();
Array<OneD, NekDouble> grad0,grad1,grad2,wkSp;
NekDouble OneDptscale = 1.5; // factor to rescale 1d points in dealiasing
{
// Get number of points to dealias a quadratic non-linearity
nPointsTot = pFields[0]->Get1DScaledTotPoints(OneDptscale);
}
grad0 = Array<OneD, NekDouble> (nPointsTot);
// interpolate Advection velocity
int nadv = pV.num_elements();
if(m_specHP_dealiasing) // interpolate advection field to higher space.
{
AdvVel[0] = Array<OneD, NekDouble> (nPointsTot*(nadv+1));
for(int i = 0; i < nadv; ++i)
{
if(i)
{
AdvVel[i] = AdvVel[i-1]+nPointsTot;
}
// interpolate infield to 3/2 dimension
pFields[0]->PhysInterp1DScaled(OneDptscale,pV[i],AdvVel[i]);
}
Outarray = AdvVel[nadv-1] + nPointsTot;
}
else
{
for(int i = 0; i < nadv; ++i)
{
AdvVel[i] = pV[i];
}
Outarray = pOutarray;
}
wkSp = Array<OneD, NekDouble> (nPointsTot);
// Evaluate V\cdot Grad(u)
switch(ndim)
{
case 1:
pFields[0]->PhysDeriv(pU,grad0);
Vmath::Vmul(nPointsTot,grad0,1,pV[0],1,pOutarray,1);
break;
case 2:
{
grad1 = Array<OneD, NekDouble> (nPointsTot);
pFields[0]->PhysDeriv(pU,grad0,grad1);
if(m_specHP_dealiasing) // interpolate gradient field
{
pFields[0]->PhysInterp1DScaled(OneDptscale,grad0,wkSp);
Vmath::Vcopy(nPointsTot,wkSp,1,grad0,1);
pFields[0]->PhysInterp1DScaled(OneDptscale,grad1,wkSp);
Vmath::Vcopy(nPointsTot,wkSp,1,grad1,1);
}
Vmath::Vmul (nPointsTot,grad0,1,AdvVel[0],1,Outarray,1);
Vmath::Vvtvp(nPointsTot,grad1,1,AdvVel[1],1,Outarray,1,Outarray,1);
if(m_specHP_dealiasing) // Galerkin project solution back to origianl space
{
pFields[0]->PhysGalerkinProjection1DScaled(OneDptscale,Outarray,pOutarray);
}
}
break;
case 3:
grad1 = Array<OneD, NekDouble> (pFields[0]->GetNpoints());
grad2 = Array<OneD, NekDouble> (pFields[0]->GetNpoints());
if(pFields[0]->GetWaveSpace() == false && m_homogen_dealiasing == true )
{
ASSERTL0(m_specHP_dealiasing == false,"Spectral/hp element dealaising is not set up for this option");
pFields[0]->PhysDeriv(pU,grad0,grad1,grad2);
pFields[0]->DealiasedProd(pV[0],grad0,grad0,m_CoeffState);
pFields[0]->DealiasedProd(pV[1],grad1,grad1,m_CoeffState);
pFields[0]->DealiasedProd(pV[2],grad2,grad2,m_CoeffState);
Vmath::Vadd(nPointsTot,grad0,1,grad1,1,pOutarray,1);
Vmath::Vadd(nPointsTot,grad2,1,pOutarray,1,pOutarray,1);
}
else if(pFields[0]->GetWaveSpace() == true && m_homogen_dealiasing == false)
{
// take d/dx, d/dy gradients in physical Fourier space
pFields[0]->PhysDeriv(pV[pVelocityComponent],grad0,grad1);
// Take d/dz derivative using wave space field
pFields[0]->PhysDeriv(MultiRegions::DirCartesianMap[2],pU,
pOutarray);
pFields[0]->HomogeneousBwdTrans(pOutarray,grad2);
if(m_specHP_dealiasing) //interpolate spectral/hp gradient field
{
pFields[0]->PhysInterp1DScaled(OneDptscale,grad0,wkSp);
Vmath::Vmul(nPointsTot,wkSp,1,AdvVel[0],1,Outarray,1);
}
else
{
Vmath::Vmul(nPointsTot,grad0,1,AdvVel[0],1,Outarray,1);
}
if(m_specHP_dealiasing) //interpolate spectral/hp gradient field
{
pFields[0]->PhysInterp1DScaled(OneDptscale,grad1,wkSp);
Vmath::Vvtvp(nPointsTot,wkSp,1,AdvVel[1],1,Outarray,1,
Outarray,1);
}
else
{
Vmath::Vvtvp(nPointsTot,grad1,1,AdvVel[1],1,Outarray,1,
Outarray,1);
}
if(m_specHP_dealiasing) //interpolate spectral/hp gradient field
{
pFields[0]->PhysInterp1DScaled(OneDptscale,grad2,wkSp);
Vmath::Vvtvp(nPointsTot,wkSp,1,AdvVel[2],1,Outarray,1,Outarray,1);
pFields[0]->PhysGalerkinProjection1DScaled(OneDptscale,Outarray,grad2);
pFields[0]->HomogeneousFwdTrans(grad2,pOutarray);
}
else
{
Vmath::Vvtvp(nPointsTot,grad2,1,AdvVel[2],1,Outarray,1,grad0,1);
pFields[0]->HomogeneousFwdTrans(grad0,pOutarray);
}
}
else if(pFields[0]->GetWaveSpace() == false && m_homogen_dealiasing == false)
{
pFields[0]->PhysDeriv(pU,grad0,grad1,grad2);
if(m_specHP_dealiasing) //interpolate spectral/hp gradient field
{
pFields[0]->PhysInterp1DScaled(OneDptscale,grad0,wkSp);
Vmath::Vmul(nPointsTot,wkSp,1,AdvVel[0],1,Outarray,1);
}
else
{
Vmath::Vmul(nPointsTot,grad0,1,AdvVel[0],1,Outarray,1);
}
if(m_specHP_dealiasing) //interpolate spectral/hp gradient field
{
pFields[0]->PhysInterp1DScaled(OneDptscale,grad1,wkSp);
Vmath::Vvtvp(nPointsTot,wkSp,1,AdvVel[1],1,Outarray,1,
Outarray,1);
}
else
{
Vmath::Vvtvp(nPointsTot,grad1,1,AdvVel[1],1,Outarray,1,
Outarray,1);
}
if(m_specHP_dealiasing) //interpolate spectral/hp gradient field
{
pFields[0]->PhysInterp1DScaled(OneDptscale,grad2,wkSp);
Vmath::Vvtvp(nPointsTot,wkSp,1,AdvVel[2],1,Outarray,1,Outarray,1);
pFields[0]->PhysGalerkinProjection1DScaled(OneDptscale,Outarray,pOutarray);
}
else
{
Vmath::Vvtvp(nPointsTot,grad2,1,AdvVel[2],1,Outarray,1,pOutarray,1);
}
}
else if(pFields[0]->GetWaveSpace() == true && m_homogen_dealiasing == true)
{
ASSERTL0(m_specHP_dealiasing == false,"Spectral/hp element dealaising is not set up for this option");
pFields[0]->PhysDeriv(pU,grad0,grad1,grad2);
pFields[0]->HomogeneousBwdTrans(grad0, pOutarray);
pFields[0]->DealiasedProd(pV[0], pOutarray, grad0,
pFields[0]->HomogeneousBwdTrans(grad1,pOutarray);
pFields[0]->DealiasedProd(pV[1], pOutarray, grad1,
pFields[0]->HomogeneousBwdTrans(grad2,pOutarray);
pFields[0]->DealiasedProd(pV[2], pOutarray, grad2,
Vmath::Vadd(nPointsTot, grad0, 1, grad1, 1, grad0, 1);
Vmath::Vadd(nPointsTot, grad0, 1, grad2, 1, grad0, 1);
pFields[0]->HomogeneousFwdTrans(grad0,pOutarray);
}
else
{
ASSERTL0(false, "Advection term calculation not implented or "
"possible with the current problem set up");
}
break;
default:
ASSERTL0(false,"dimension unknown");
}
}

Friends And Related Function Documentation

friend class MemoryManager< NavierStokesAdvection >
friend

Definition at line 56 of file NavierStokesAdvection.h.

Member Data Documentation

string Nektar::NavierStokesAdvection::className = GetAdvectionTermFactory().RegisterCreatorFunction("Convective", NavierStokesAdvection::create)
static

Name of class.

Definition at line 67 of file NavierStokesAdvection.h.

string Nektar::NavierStokesAdvection::className2 = GetAdvectionTermFactory().RegisterCreatorFunction("NonConservative", NavierStokesAdvection::create)
static

Definition at line 68 of file NavierStokesAdvection.h.