Commit ab3f44e4 authored by Daniele de Grazia's avatar Daniele de Grazia
Browse files

Function to obtain fluxVector

parent 879160aa
......@@ -63,5 +63,12 @@ namespace Nektar
{
v_Advect(nConvectiveFields, fields, advVel, inarray, outarray);
}
void Advection::FluxVec(
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &fluxvector)
{
v_FluxVec(fluxvector);
}
}
}
......@@ -67,6 +67,10 @@ namespace Nektar
const Array<OneD, Array<OneD, NekDouble> > &advVel,
const Array<OneD, Array<OneD, NekDouble> > &inarray,
Array<OneD, Array<OneD, NekDouble> > &outarray);
SOLVER_UTILS_EXPORT void FluxVec(
Array<OneD, Array<OneD, Array<OneD, NekDouble> > >
&fluxvector);
template<typename FuncPointerT, typename ObjectPointerT>
void SetFluxVector(FuncPointerT func, ObjectPointerT obj)
......@@ -99,6 +103,13 @@ namespace Nektar
const Array<OneD, Array<OneD, NekDouble> > &inarray,
Array<OneD, Array<OneD, NekDouble> > &outarray)=0;
virtual void v_FluxVec(
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &fluxvector)
{
};
AdvectionFluxVecCB m_fluxVector;
RiemannSolverSharedPtr m_riemann;
};
......
......@@ -70,7 +70,7 @@ namespace Nektar
Array<OneD, Array<OneD, NekDouble> > m_dGR_xi3;
DNekMatSharedPtr m_Ixm;
DNekMatSharedPtr m_Ixp;
protected:
AdvectionFR(std::string advType);
......@@ -83,6 +83,20 @@ namespace Nektar
LibUtilities::SessionReaderSharedPtr pSession,
Array<OneD, MultiRegions::ExpListSharedPtr> pFields);
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);
virtual void v_FluxVec(
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &fluxvector)
{
fluxvector = m_fluxvector;
};
virtual void v_SetupMetrics(
LibUtilities::SessionReaderSharedPtr pSession,
Array<OneD, MultiRegions::ExpListSharedPtr> pFields);
......@@ -95,12 +109,6 @@ namespace Nektar
LibUtilities::SessionReaderSharedPtr pSession,
Array<OneD, MultiRegions::ExpListSharedPtr> pFields);
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);
virtual void v_DivCFlux_1D(
const int nConvectiveFields,
......
......@@ -64,8 +64,8 @@ namespace Nektar
int nCoeffs = fields[0]->GetNcoeffs();
int nTracePointsTot = fields[0]->GetTrace()->GetTotPoints();
Array<OneD, Array<OneD, Array<OneD, NekDouble> > >
fluxvector(nConvectiveFields);
m_fluxvector = Array<OneD, Array<OneD, Array<OneD, NekDouble> > >
(nConvectiveFields);
Array<OneD, Array<OneD, NekDouble> > tmp(nConvectiveFields);
ASSERTL1(m_riemann,
......@@ -73,10 +73,10 @@ namespace Nektar
for (i = 0; i < nConvectiveFields; ++i)
{
fluxvector[i] = Array<OneD, Array<OneD, NekDouble> >(spaceDim);
m_fluxvector[i] = Array<OneD, Array<OneD, NekDouble> >(spaceDim);
for(j = 0; j < spaceDim ; ++j)
{
fluxvector[i][j] = Array<OneD, NekDouble>(nPointsTot, 0.0);
m_fluxvector[i][j] = Array<OneD, NekDouble>(nPointsTot, 0.0);
}
}
......@@ -88,22 +88,22 @@ namespace Nektar
cin >> num;
*/
m_fluxVector(inarray, fluxvector);
m_fluxVector(inarray, m_fluxvector);
/*
for (j = 0; j < nPointsTot; ++j)
{
cout << "fluxvector0" << " "<< j << " "<< fluxvector[0][1][j]<< " " << endl;
cout << "fluxvector0" << " "<< j << " "<< m_fluxvector[0][1][j]<< " " << endl;
}
cin >> num;
for (j = 0; j < nPointsTot; ++j)
{
cout << "fluxvector1" << " "<< j << " "<< fluxvector[0][0][j]<< " " << endl;
cout << "fluxvector1" << " "<< j << " "<< m_fluxvector[0][0][j]<< " " << endl;
}
*/
*/
// Get the advection part (without numerical flux)
for(i = 0; i < nConvectiveFields; ++i)
......@@ -112,7 +112,7 @@ namespace Nektar
for (j = 0; j < nExpDim; ++j)
{
fields[i]->IProductWRTDerivBase(j, fluxvector[i][j],
fields[i]->IProductWRTDerivBase(j, m_fluxvector[i][j],
outarray[i]);
Vmath::Vadd(nCoeffs, outarray[i], 1, tmp[i], 1, tmp[i], 1);
}
......
......@@ -52,18 +52,25 @@ namespace Nektar
static std::string type;
protected:
AdvectionWeakDG();
virtual void v_Advect(
const int nConvective,
const int nConvective,
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);
protected:
AdvectionWeakDG();
Array<OneD, Array<OneD, NekDouble> > m_traceNormals;
virtual void v_FluxVec(
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &fluxvector)
{
fluxvector = m_fluxvector;
};
Array<OneD, Array<OneD, NekDouble> > m_traceNormals;
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_fluxvector;
};
}
......
......@@ -154,7 +154,7 @@ namespace Nektar
&outarray[j][i * nPointsTot_plane], 1);
}
m_fluxVector(inarray_plane[i], fluxvector_homo[i]);
m_planeAdv->FluxVec(fluxvector_homo[i]);
for ( j = 0; j < nConvectiveFields; ++j)
{
......
......@@ -62,5 +62,11 @@ namespace Nektar
{
v_Diffuse(nConvectiveFields, fields, inarray, outarray);
}
void Diffusion::FluxVec(
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &fluxvector)
{
v_FluxVec(fluxvector);
}
}
}
......@@ -76,6 +76,10 @@ namespace Nektar
const Array<OneD, Array<OneD, NekDouble> > &inarray,
Array<OneD, Array<OneD, NekDouble> > &outarray);
SOLVER_UTILS_EXPORT void FluxVec(
Array<OneD, Array<OneD, Array<OneD, NekDouble> > >
&fluxvector);
template<typename FuncPointerT, typename ObjectPointerT>
void SetFluxVector(FuncPointerT func, ObjectPointerT obj)
{
......@@ -117,6 +121,13 @@ namespace Nektar
const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
const Array<OneD, Array<OneD, NekDouble> > &inarray,
Array<OneD, Array<OneD, NekDouble> > &outarray)=0;
virtual void v_FluxVec(
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &fluxvector)
{
};
DiffusionFluxVecCB m_fluxVector;
DiffusionFluxVecCBNS m_fluxVectorNS;
......
......@@ -156,17 +156,17 @@ namespace Nektar
}
// Initialisation viscous tensor
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > viscousTensor(
m_spaceDim);
m_viscTensor = Array<OneD, Array<OneD, Array<OneD, NekDouble> > >
(m_spaceDim);
Array<OneD, Array<OneD, NekDouble> > viscousFlux(nConvectiveFields);
for (j = 0; j < m_spaceDim; ++j)
{
viscousTensor[j] = Array<OneD, Array<OneD, NekDouble> >(
m_viscTensor[j] = Array<OneD, Array<OneD, NekDouble> >(
nScalars+1);
for (i = 0; i < nScalars+1; ++i)
{
viscousTensor[j][i] = Array<OneD, NekDouble>(nPts, 0.0);
m_viscTensor[j][i] = Array<OneD, NekDouble>(nPts, 0.0);
}
}
......@@ -175,11 +175,11 @@ namespace Nektar
viscousFlux[i] = Array<OneD, NekDouble>(nPts, 0.0);
}
m_fluxVectorNS(inarray, derivativesO1, viscousTensor);
m_fluxVectorNS(inarray, derivativesO1, m_viscTensor);
// Compute u from q_{\eta} and q_{\xi}
// Obtain numerical fluxes
v_NumericalFluxO2(fields, inarray, viscousTensor, viscousFlux);
v_NumericalFluxO2(fields, inarray, m_viscTensor, viscousFlux);
for (i = 0; i < nConvectiveFields; ++i)
{
......@@ -189,7 +189,7 @@ namespace Nektar
{
//Vmath::Vcopy(nPts, qfield[j][i], 1, fluxvector[j], 1);
fields[i]->IProductWRTDerivBase(j, viscousTensor[j][i],
fields[i]->IProductWRTDerivBase(j, m_viscTensor[j][i],
tmp1);
Vmath::Vadd(nCoeffs, tmp1, 1, tmp2[i], 1, tmp2[i], 1);
......
......@@ -67,6 +67,8 @@ namespace Nektar
NekDouble m_rhoInf;
NekDouble m_pInf;
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_viscTensor;
int m_spaceDim;
virtual void v_InitObject(
......@@ -102,6 +104,12 @@ namespace Nektar
const int dir,
const Array<OneD, const NekDouble> &qfield,
Array<OneD, NekDouble> &penaltyflux);
virtual void v_FluxVec(
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &fluxvector)
{
//fluxvector = m_ViscosityType;
};
};
}
}
......
......@@ -69,9 +69,6 @@ namespace Nektar
DNekMatSharedPtr m_Ixm;
DNekMatSharedPtr m_Ixp;
int m_spaceDim;
protected:
DiffusionLFRNS(std::string diffType);
......@@ -87,6 +84,7 @@ namespace Nektar
NekDouble m_rhoInf;
NekDouble m_pInf;
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_IF1;
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_DU1;
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_DFC1;
......@@ -102,6 +100,8 @@ namespace Nektar
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_tmp1;
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_tmp2;
int m_spaceDim;
std::string m_diffType;
virtual void v_InitObject(
......@@ -172,6 +172,14 @@ namespace Nektar
const Array<OneD, const NekDouble> &fluxX2,
const Array<OneD, const NekDouble> &numericalFlux,
Array<OneD, NekDouble> &divCFlux);
virtual void v_FluxVec(
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &fluxvector)
{
fluxvector = m_viscTensor;
};
};
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment