Nektar++
|
#include <DiffusionLFR.h>
Static Public Member Functions | |
static DiffusionSharedPtr | create (std::string diffType) |
Static Public Attributes | |
static std::string | type [] |
Protected Member Functions | |
DiffusionLFR (std::string diffType) | |
DiffusionLFR uses the Flux Reconstruction (FR) approach to compute the diffusion term. The implementation is only for segments, quadrilaterals and hexahedra at the moment. More... | |
void | v_InitObject (LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields) override |
Initiliase DiffusionLFR objects and store them before starting the time-stepping. More... | |
void | v_Diffuse (const size_t nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd) override |
Calculate FR Diffusion for the linear problems using an LDG interface flux. More... | |
Protected Member Functions inherited from Nektar::SolverUtils::Diffusion | |
virtual SOLVER_UTILS_EXPORT void | v_InitObject (LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields)=0 |
virtual SOLVER_UTILS_EXPORT void | v_Diffuse (const std::size_t nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd)=0 |
virtual SOLVER_UTILS_EXPORT void | v_DiffuseCoeffs (const std::size_t nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd) |
virtual SOLVER_UTILS_EXPORT void | v_DiffuseCalcDerivative (const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, TensorOfArray3D< NekDouble > &qfields, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd) |
Diffusion Flux, calculate the physical derivatives. More... | |
virtual SOLVER_UTILS_EXPORT void | v_DiffuseVolumeFlux (const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, TensorOfArray3D< NekDouble > &qfields, TensorOfArray3D< NekDouble > &VolumeFlux, Array< OneD, int > &nonZeroIndex) |
Diffusion Volume Flux. More... | |
virtual SOLVER_UTILS_EXPORT void | v_DiffuseTraceFlux (const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, TensorOfArray3D< NekDouble > &Qfields, TensorOfArray3D< NekDouble > &VolumeFlux, Array< OneD, Array< OneD, NekDouble > > &TraceFlux, const Array< OneD, Array< OneD, NekDouble > > &pFwd, const Array< OneD, Array< OneD, NekDouble > > &pBwd, Array< OneD, int > &nonZeroIndex) |
Diffusion term Trace Flux. More... | |
virtual void | v_SetHomoDerivs (Array< OneD, Array< OneD, NekDouble > > &deriv) |
virtual TensorOfArray3D< NekDouble > & | v_GetFluxTensor () |
virtual SOLVER_UTILS_EXPORT const Array< OneD, const Array< OneD, NekDouble > > & | v_GetTraceNormal () |
Protected Attributes | |
std::string | m_diffType |
Protected Attributes inherited from Nektar::SolverUtils::Diffusion | |
Array< OneD, NekDouble > | m_divVel |
Params for Ducros sensor. More... | |
Array< OneD, NekDouble > | m_divVelSquare |
Array< OneD, NekDouble > | m_curlVelSquare |
DiffusionFluxVecCB | m_fluxVector |
DiffusionFluxVecCBNS | m_fluxVectorNS |
DiffusionFluxPenaltyNS | m_fluxPenaltyNS |
DiffusionFluxCons | m_FunctorDiffusionfluxCons |
DiffusionFluxCons | m_FunctorDiffusionfluxConsTrace |
SpecialBndTreat | m_SpecialBndTreat |
DiffusionSymmFluxCons | m_FunctorSymmetricfluxCons |
Array< OneD, Array< OneD, NekDouble > > | m_gridVelocityTrace |
NekDouble | m_time = 0.0 |
Private Member Functions | |
void | SetupMetrics (LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields) |
Setup the metric terms to compute the contravariant fluxes. (i.e. this special metric terms transform the fluxes at the interfaces of each element from the physical space to the standard space). More... | |
void | SetupCFunctions (LibUtilities::SessionReaderSharedPtr pSession, Array< OneD, MultiRegions::ExpListSharedPtr > pFields) |
Setup the derivatives of the correction functions. For more details see J Sci Comput (2011) 47: 50–72. More... | |
void | NumFluxforScalar (const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &ufield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &uflux) |
Builds the numerical flux for the 1st order derivatives. More... | |
void | WeakPenaltyforScalar (const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const int var, const Array< OneD, const NekDouble > &ufield, Array< OneD, NekDouble > &penaltyflux) |
Imposes appropriate bcs for the 1st order derivatives. More... | |
void | NumFluxforVector (const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &ufield, Array< OneD, Array< OneD, Array< OneD, NekDouble > > > &qfield, Array< OneD, Array< OneD, NekDouble > > &qflux) |
Build the numerical flux for the 2nd order derivatives. More... | |
void | WeakPenaltyforVector (const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const int var, const int dir, const Array< OneD, const NekDouble > &qfield, Array< OneD, NekDouble > &penaltyflux, NekDouble C11) |
Imposes appropriate bcs for the 2nd order derivatives. More... | |
void | DerCFlux_1D (const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, const NekDouble > &flux, const Array< OneD, const NekDouble > &iFlux, Array< OneD, NekDouble > &derCFlux) |
Compute the derivative of the corrective flux for 1D problems. More... | |
void | DerCFlux_2D (const int nConvectiveFields, const int direction, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, const NekDouble > &flux, const Array< OneD, NekDouble > &iFlux, Array< OneD, NekDouble > &derCFlux) |
Compute the derivative of the corrective flux wrt a given coordinate for 2D problems. More... | |
void | DivCFlux_2D (const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, const NekDouble > &fluxX1, const Array< OneD, const NekDouble > &fluxX2, const Array< OneD, const NekDouble > &numericalFlux, Array< OneD, NekDouble > &divCFlux) |
Compute the divergence of the corrective flux for 2D problems. More... | |
void | DivCFlux_2D_Gauss (const int nConvectiveFields, const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, const NekDouble > &fluxX1, const Array< OneD, const NekDouble > &fluxX2, const Array< OneD, const NekDouble > &numericalFlux, Array< OneD, NekDouble > &divCFlux) |
Compute the divergence of the corrective flux for 2D problems where POINTSTYPE="GaussGaussLegendre". More... | |
Definition at line 42 of file DiffusionLFR.h.
|
protected |
DiffusionLFR uses the Flux Reconstruction (FR) approach to compute the diffusion term. The implementation is only for segments, quadrilaterals and hexahedra at the moment.
Definition at line 67 of file DiffusionLFR.cpp.
Referenced by create().
|
inlinestatic |
Definition at line 45 of file DiffusionLFR.h.
References DiffusionLFR().
|
private |
Compute the derivative of the corrective flux for 1D problems.
nConvectiveFields | Number of fields. |
fields | Pointer to fields. |
flux | Volumetric flux in the physical space. |
iFlux | Numerical interface flux in physical space. |
derCFlux | Derivative of the corrective flux. |
Definition at line 1437 of file DiffusionLFR.cpp.
References Nektar::LocalRegions::Expansion::GetMetricInfo(), m_dGL_xi1, m_dGR_xi1, Vmath::Smul(), Vmath::Vadd(), and Vmath::Vcopy().
Referenced by v_Diffuse().
|
private |
Compute the derivative of the corrective flux wrt a given coordinate for 2D problems.
There could be a bug for deformed elements since first derivatives are not exactly the same results of DiffusionLDG as expected
nConvectiveFields | Number of fields. |
fields | Pointer to fields. |
flux | Volumetric flux in the physical space. |
numericalFlux | Numerical interface flux in physical space. |
derCFlux | Derivative of the corrective flux. |
Definition at line 1556 of file DiffusionLFR.cpp.
References ASSERTL0, Nektar::StdRegions::eBackwards, Nektar::SpatialDomains::eDeformed, Nektar::LocalRegions::Expansion::GetMetricInfo(), m_dGL_xi1, m_dGL_xi2, m_dGR_xi1, m_dGR_xi2, Vmath::Reverse(), Vmath::Smul(), Vmath::Vadd(), and Vmath::Vsub().
Referenced by v_Diffuse().
|
private |
Compute the divergence of the corrective flux for 2D problems.
nConvectiveFields | Number of fields. |
fields | Pointer to fields. |
fluxX1 | X1 - volumetric flux in physical space. |
fluxX2 | X2 - volumetric flux in physical space. |
numericalFlux | Interface flux in physical space. |
divCFlux | Divergence of the corrective flux for 2D problems. |
Definition at line 1752 of file DiffusionLFR.cpp.
References ASSERTL0, Nektar::StdRegions::eBackwards, m_dGL_xi1, m_dGL_xi2, m_dGR_xi1, m_dGR_xi2, m_Q2D_e0, m_Q2D_e1, m_Q2D_e2, m_Q2D_e3, m_traceNormals, Vmath::Reverse(), Vmath::Vadd(), and Vmath::Vsub().
Referenced by v_Diffuse().
|
private |
Compute the divergence of the corrective flux for 2D problems where POINTSTYPE="GaussGaussLegendre".
nConvectiveFields | Number of fields. |
fields | Pointer to fields. |
fluxX1 | X1-volumetric flux in physical space. |
fluxX2 | X2-volumetric flux in physical space. |
numericalFlux | Interface flux in physical space. |
divCFlux | Divergence of the corrective flux. |
Definition at line 1940 of file DiffusionLFR.cpp.
References ASSERTL0, Nektar::StdRegions::eBackwards, m_dGL_xi1, m_dGL_xi2, m_dGR_xi1, m_dGR_xi2, m_Q2D_e0, m_Q2D_e1, m_Q2D_e2, m_Q2D_e3, m_traceNormals, Vmath::Neg(), Vmath::Reverse(), Vmath::Vadd(), Vmath::Vcopy(), and Vmath::Vsub().
Referenced by v_Diffuse().
|
private |
Builds the numerical flux for the 1st order derivatives.
Definition at line 1161 of file DiffusionLFR.cpp.
References m_traceNormals, Vmath::Svtvp(), Vmath::Vcopy(), and WeakPenaltyforScalar().
Referenced by v_Diffuse().
|
private |
Build the numerical flux for the 2nd order derivatives.
Definition at line 1298 of file DiffusionLFR.cpp.
References m_traceNormals, Vmath::Svtvp(), Vmath::Vadd(), Vmath::Vmul(), and WeakPenaltyforVector().
Referenced by v_Diffuse().
|
private |
Setup the derivatives of the correction functions. For more details see J Sci Comput (2011) 47: 50–72.
This routine calls 3 different bases: #eDG_DG_Left - #eDG_DG_Left which recovers a nodal DG scheme, #eDG_SD_Left - #eDG_SD_Left which recovers the SD scheme, #eDG_HU_Left - #eDG_HU_Left which recovers the Huynh scheme.
The values of the derivatives of the correction function are then stored into global variables and reused into the Functions #DivCFlux_1D, DivCFlux_2D, #DivCFlux_3D to compute the the divergence of the correction flux for 1D, 2D or 3D problems.
pSession | Pointer to session reader. |
pFields | Pointer to fields. |
Definition at line 324 of file DiffusionLFR.cpp.
References ASSERTL0, Polylib::jacobd(), m_dGL_xi1, m_dGL_xi2, m_dGL_xi3, m_dGR_xi1, m_dGR_xi2, m_dGR_xi3, and m_diffType.
Referenced by v_InitObject().
|
private |
Setup the metric terms to compute the contravariant fluxes. (i.e. this special metric terms transform the fluxes at the interfaces of each element from the physical space to the standard space).
This routine calls the function #GetTraceQFactors to compute and store the metric factors following an anticlockwise conventions along the edges/faces of each element. Note: for 1D problem the transformation is not needed.
pSession | Pointer to session reader. |
pFields | Pointer to fields. |
Definition at line 162 of file DiffusionLFR.cpp.
References ASSERTL0, Nektar::SpatialDomains::eDeformed, Nektar::LocalRegions::Expansion::GetMetricInfo(), m_gmat, m_jac, m_Q2D_e0, m_Q2D_e1, m_Q2D_e2, m_Q2D_e3, and m_traceNormals.
Referenced by v_InitObject().
|
overrideprotected |
Calculate FR Diffusion for the linear problems using an LDG interface flux.
Definition at line 861 of file DiffusionLFR.cpp.
References ASSERTL0, DerCFlux_1D(), DerCFlux_2D(), DivCFlux_2D(), DivCFlux_2D_Gauss(), Nektar::LibUtilities::eGaussGaussLegendre, m_BD1, m_D1, m_DD1, m_DFC1, m_DFC2, m_divFC, m_divFD, m_DU1, m_gmat, m_IF1, m_IF2, m_jac, m_tmp1, m_tmp2, NumFluxforScalar(), NumFluxforVector(), Vmath::Vadd(), Vmath::Vcopy(), Vmath::Vdiv(), and Vmath::Vmul().
|
overrideprotectedvirtual |
Initiliase DiffusionLFR objects and store them before starting the time-stepping.
This routine calls the functions SetupMetrics and SetupCFunctions to initialise the objects needed by DiffusionLFR.
pSession | Pointer to session reader. |
pFields | Pointer to fields. |
Implements Nektar::SolverUtils::Diffusion.
Definition at line 81 of file DiffusionLFR.cpp.
References m_BD1, m_D1, m_DD1, m_DFC1, m_DFC2, m_divFC, m_divFD, m_DU1, m_IF1, m_IF2, m_session, m_tmp1, m_tmp2, SetupCFunctions(), and SetupMetrics().
|
private |
Imposes appropriate bcs for the 1st order derivatives.
Definition at line 1235 of file DiffusionLFR.cpp.
References Nektar::SpatialDomains::eDirichlet, Nektar::SpatialDomains::eNeumann, and Vmath::Vcopy().
Referenced by NumFluxforScalar().
|
private |
Imposes appropriate bcs for the 2nd order derivatives.
Definition at line 1371 of file DiffusionLFR.cpp.
References Nektar::SpatialDomains::eDirichlet, Nektar::SpatialDomains::eNeumann, m_traceNormals, and Vmath::Vmul().
Referenced by NumFluxforVector().
Definition at line 92 of file DiffusionLFR.h.
Referenced by v_Diffuse(), and v_InitObject().
Definition at line 93 of file DiffusionLFR.h.
Referenced by v_Diffuse(), and v_InitObject().
Definition at line 94 of file DiffusionLFR.h.
Referenced by v_Diffuse(), and v_InitObject().
|
private |
Definition at line 91 of file DiffusionLFR.h.
Referenced by v_Diffuse(), and v_InitObject().
|
private |
Definition at line 96 of file DiffusionLFR.h.
Referenced by v_Diffuse(), and v_InitObject().
Definition at line 80 of file DiffusionLFR.h.
Referenced by DerCFlux_1D(), DerCFlux_2D(), DivCFlux_2D(), DivCFlux_2D_Gauss(), and SetupCFunctions().
Definition at line 82 of file DiffusionLFR.h.
Referenced by DerCFlux_2D(), DivCFlux_2D(), DivCFlux_2D_Gauss(), and SetupCFunctions().
Definition at line 84 of file DiffusionLFR.h.
Referenced by SetupCFunctions().
Definition at line 81 of file DiffusionLFR.h.
Referenced by DerCFlux_1D(), DerCFlux_2D(), DivCFlux_2D(), DivCFlux_2D_Gauss(), and SetupCFunctions().
Definition at line 83 of file DiffusionLFR.h.
Referenced by DerCFlux_2D(), DivCFlux_2D(), DivCFlux_2D_Gauss(), and SetupCFunctions().
Definition at line 85 of file DiffusionLFR.h.
Referenced by SetupCFunctions().
|
protected |
Definition at line 55 of file DiffusionLFR.h.
Referenced by SetupCFunctions().
Definition at line 98 of file DiffusionLFR.h.
Referenced by v_Diffuse(), and v_InitObject().
Definition at line 97 of file DiffusionLFR.h.
Referenced by v_Diffuse(), and v_InitObject().
Definition at line 90 of file DiffusionLFR.h.
Referenced by v_Diffuse(), and v_InitObject().
Definition at line 73 of file DiffusionLFR.h.
Referenced by SetupMetrics(), and v_Diffuse().
Definition at line 89 of file DiffusionLFR.h.
Referenced by v_Diffuse(), and v_InitObject().
Definition at line 95 of file DiffusionLFR.h.
Referenced by v_Diffuse(), and v_InitObject().
|
private |
Definition at line 86 of file DiffusionLFR.h.
|
private |
Definition at line 87 of file DiffusionLFR.h.
Definition at line 72 of file DiffusionLFR.h.
Referenced by SetupMetrics(), and v_Diffuse().
Definition at line 75 of file DiffusionLFR.h.
Referenced by DivCFlux_2D(), DivCFlux_2D_Gauss(), and SetupMetrics().
Definition at line 76 of file DiffusionLFR.h.
Referenced by DivCFlux_2D(), DivCFlux_2D_Gauss(), and SetupMetrics().
Definition at line 77 of file DiffusionLFR.h.
Referenced by DivCFlux_2D(), DivCFlux_2D_Gauss(), and SetupMetrics().
Definition at line 78 of file DiffusionLFR.h.
Referenced by DivCFlux_2D(), DivCFlux_2D_Gauss(), and SetupMetrics().
|
private |
Definition at line 70 of file DiffusionLFR.h.
Referenced by v_InitObject().
|
private |
Definition at line 100 of file DiffusionLFR.h.
Referenced by v_Diffuse(), and v_InitObject().
|
private |
Definition at line 101 of file DiffusionLFR.h.
Referenced by v_Diffuse(), and v_InitObject().
Definition at line 69 of file DiffusionLFR.h.
Referenced by DivCFlux_2D(), DivCFlux_2D_Gauss(), NumFluxforScalar(), NumFluxforVector(), SetupMetrics(), and WeakPenaltyforVector().
|
static |
Definition at line 50 of file DiffusionLFR.h.