Commit 150681e2 authored by Dave Moxey's avatar Dave Moxey
Browse files

Merge branch 'feature/CFS-RealGas' into 'master'

Real gas in compressible solver

See merge request !880
parents 49c7ef6b 7bf00373
......@@ -86,6 +86,7 @@ v5.0.0
- Allow performing axi-symmetric Euler simulations (!771)
- Add ability to use an exponential filtering for stabilization with
seg, quad and hex elements (!771, !862)
- Introduce equations of state to account for real gas effects (!880)
**APESolver:**
- Added two new boundary conditions to the APE system: RiemannInvariantBC
......
......@@ -243,6 +243,7 @@ Under this section it is possible to set the solver information.
<I PROPERTY="UpwindType" VALUE="ExactToro" />
<I PROPERTY="ProblemType" VALUE="General" />
<I PROPERTY="ViscosityType" VALUE="Constant" />
<I PROPERTY="EquationOfState" VALUE="IdealGas" />
</SOLVERINFO>
\end{lstlisting}
\begin{itemize}
......@@ -303,6 +304,15 @@ we want to use for the advection operator:
\item \inltt{Constant} (Constant viscosity);
\item \inltt{Variable} (Variable viscosity through the Sutherland's law.);
\end{itemize}
\item \inltt{EquationOfState} allows selecting an equation of state for
accounting for non-ideal gas behaviour:
\begin{itemize}
\item \inltt{IdealGas} (default option);
\item \inltt{VanDerWaals} (requires additional parameters \inltt{Tcrit} and \inltt{Pcrit});
\item \inltt{RedlichKwong} (requires additional parameters \inltt{Tcrit} and \inltt{Pcrit});
\item \inltt{PengRobinson} (requires additional parameters \inltt{Tcrit}, \inltt{Pcrit} and
\inltt{AcentricFactor});
\end{itemize}
\end{itemize}
\subsection*{Boundary conditions}
......
......@@ -10,7 +10,6 @@ SET(SOLVER_UTILS_SOURCES
Diffusion/Diffusion.cpp
Diffusion/Diffusion3DHomogeneous1D.cpp
Diffusion/DiffusionLDG.cpp
Diffusion/DiffusionLDGNS.cpp
Diffusion/DiffusionLFR.cpp
Diffusion/DiffusionLFRNS.cpp
Driver.cpp
......@@ -55,7 +54,6 @@ SET(SOLVER_UTILS_HEADERS
Diffusion/Diffusion.h
Diffusion/Diffusion3DHomogeneous1D.h
Diffusion/DiffusionLDG.h
Diffusion/DiffusionLDGNS.h
Diffusion/DiffusionLFR.h
Diffusion/DiffusionLFRNS.h
Driver.h
......
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////////
//
// File: DiffusionLDGNS.h
//
// For more information, please see: http://www.nektar.info
//
// The MIT License
//
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
// Department of Aeronautics, Imperial College London (UK), and Scientific
// Computing and Imaging Institute, University of Utah (USA).
//
// License for the specific language governing rights and limitations under
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: LDG diffusion class.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef NEKTAR_SOLVERUTILS_DIFFUSIONLDGNS
#define NEKTAR_SOLVERUTILS_DIFFUSIONLDGNS
#include <SolverUtils/Diffusion/Diffusion.h>
namespace Nektar
{
namespace SolverUtils
{
class DiffusionLDGNS : public Diffusion
{
public:
static DiffusionSharedPtr create(std::string diffType)
{
return DiffusionSharedPtr(new DiffusionLDGNS());
}
static std::string type;
protected:
DiffusionLDGNS();
Array<OneD, Array<OneD, NekDouble> > m_traceVel;
Array<OneD, Array<OneD, NekDouble> > m_traceNormals;
LibUtilities::SessionReaderSharedPtr m_session;
NekDouble m_gamma;
NekDouble m_gasConstant;
NekDouble m_Twall;
std::string m_ViscosityType;
NekDouble m_mu;
NekDouble m_thermalConductivity;
NekDouble m_rhoInf;
NekDouble m_pInf;
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_viscTensor;
Array<OneD, Array<OneD, NekDouble> > m_homoDerivs;
int m_spaceDim;
int m_diffDim;
virtual void v_InitObject(
LibUtilities::SessionReaderSharedPtr pSession,
Array<OneD, MultiRegions::ExpListSharedPtr> pFields);
virtual void v_Diffuse(
const int nConvective,
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 = NullNekDoubleArrayofArray,
const Array<OneD, Array<OneD, NekDouble> > &pBwd = NullNekDoubleArrayofArray);
virtual void v_NumericalFluxO1(
const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
const Array<OneD, Array<OneD, NekDouble> > &inarray,
Array<OneD, Array<OneD, Array<OneD, NekDouble> > >
&numericalFluxO1,
const Array<OneD, Array<OneD, NekDouble> > &pFwd = NullNekDoubleArrayofArray,
const Array<OneD, Array<OneD, NekDouble> > &pBwd = NullNekDoubleArrayofArray);
virtual void v_WeakPenaltyO1(
const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
const Array<OneD, Array<OneD, NekDouble> > &inarray,
const Array<OneD, Array<OneD, NekDouble> > &uplus,
Array<OneD, Array<OneD, NekDouble> > &penaltyfluxO1);
virtual void v_NumericalFluxO2(
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);
virtual void v_WeakPenaltyO2(
const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
const int var,
const int dir,
const Array<OneD, const NekDouble> &qfield,
const Array<OneD, const NekDouble> &qtemp,
Array<OneD, NekDouble> &penaltyflux);
virtual void v_SetHomoDerivs(
Array<OneD, Array<OneD, NekDouble> > &deriv)
{
m_homoDerivs = deriv;
}
virtual Array<OneD, Array<OneD, Array<OneD, NekDouble> > > &v_GetFluxTensor()
{
return m_viscTensor;
}
};
typedef std::shared_ptr<DiffusionLDGNS> DiffusionLDGNSSharedPtr;
}
}
#endif
......@@ -72,8 +72,9 @@ namespace Nektar
* which solvers for various Riemann problems can be implemented.
*/
RiemannSolver::RiemannSolver() : m_requiresRotation(false),
m_rotStorage (3)
RiemannSolver::RiemannSolver(
const LibUtilities::SessionReaderSharedPtr& pSession)
: m_requiresRotation(false), m_rotStorage (3)
{
}
......
......@@ -36,6 +36,7 @@
#ifndef NEKTAR_SOLVERUTILS_RIEMANNSOLVER
#define NEKTAR_SOLVERUTILS_RIEMANNSOLVER
#include <LibUtilities/BasicUtils/SessionReader.h>
#include <LibUtilities/BasicUtils/NekFactory.hpp>
#include <LibUtilities/LinearAlgebra/NekTypeDefs.hpp>
#include <SolverUtils/SolverUtilsDeclspec.h>
......@@ -156,7 +157,8 @@ namespace Nektar
/// Rotation storage
Array<OneD, Array<OneD, Array<OneD, NekDouble> > > m_rotStorage;
SOLVER_UTILS_EXPORT RiemannSolver();
SOLVER_UTILS_EXPORT RiemannSolver(
const LibUtilities::SessionReaderSharedPtr& pSession);
virtual void v_Solve(
const int nDim,
......@@ -191,7 +193,8 @@ namespace Nektar
typedef std::shared_ptr<RiemannSolver> RiemannSolverSharedPtr;
/// Datatype of the NekFactory used to instantiate classes derived
/// from the RiemannSolver class.
typedef LibUtilities::NekFactory<std::string, RiemannSolver>
typedef LibUtilities::NekFactory<std::string, RiemannSolver,
const LibUtilities::SessionReaderSharedPtr&>
RiemannSolverFactory;
SOLVER_UTILS_EXPORT RiemannSolverFactory& GetRiemannSolverFactory();
}
......
......@@ -63,8 +63,9 @@ namespace Nektar
/**
* @brief Default constructor.
*/
UpwindLDGSolver::UpwindLDGSolver() :
RiemannSolver()
UpwindLDGSolver::UpwindLDGSolver(
const LibUtilities::SessionReaderSharedPtr& pSession) :
RiemannSolver(pSession)
{
}
......
......@@ -46,16 +46,18 @@ namespace Nektar
class UpwindLDGSolver : public RiemannSolver
{
public:
SOLVER_UTILS_EXPORT static RiemannSolverSharedPtr create()
SOLVER_UTILS_EXPORT static RiemannSolverSharedPtr create(
const LibUtilities::SessionReaderSharedPtr& pSession)
{
return RiemannSolverSharedPtr(
new UpwindLDGSolver());
new UpwindLDGSolver(pSession));
}
static std::string solverName;
protected:
UpwindLDGSolver();
UpwindLDGSolver(
const LibUtilities::SessionReaderSharedPtr& pSession);
virtual void v_Solve(
const int nDim,
......
......@@ -63,8 +63,9 @@ namespace Nektar
/**
* @brief Default constructor.
*/
UpwindSolver::UpwindSolver() :
RiemannSolver()
UpwindSolver::UpwindSolver(
const LibUtilities::SessionReaderSharedPtr& pSession)
: RiemannSolver(pSession)
{
}
......
......@@ -46,16 +46,18 @@ namespace Nektar
class UpwindSolver : public RiemannSolver
{
public:
SOLVER_UTILS_EXPORT static RiemannSolverSharedPtr create()
SOLVER_UTILS_EXPORT static RiemannSolverSharedPtr create(
const LibUtilities::SessionReaderSharedPtr& pSession)
{
return RiemannSolverSharedPtr(
new UpwindSolver());
new UpwindSolver(pSession));
}
static std::string solverName;
protected:
UpwindSolver();
UpwindSolver(
const LibUtilities::SessionReaderSharedPtr& pSession);
virtual void v_Solve(
const int nDim,
......
......@@ -92,7 +92,8 @@ namespace Nektar
m_session->LoadSolverInfo(
"UpwindType", riemName, "Upwind");
m_riemannSolver = SolverUtils::
GetRiemannSolverFactory().CreateInstance(riemName);
GetRiemannSolverFactory().CreateInstance(
riemName, m_session);
m_riemannSolver->SetScalar(
"Vn", &CFLtester::GetNormalVelocity, this);
......
......@@ -87,7 +87,8 @@ namespace Nektar
m_session->LoadSolverInfo(
"UpwindType", riemName, "Upwind");
m_riemannSolver = SolverUtils::
GetRiemannSolverFactory().CreateInstance(riemName);
GetRiemannSolverFactory().CreateInstance(
riemName, m_session);
m_riemannSolver->SetScalar(
"Vn", &EigenValuesAdvection::GetNormalVelocity, this);
......
......@@ -131,7 +131,8 @@ namespace Nektar
m_session->LoadSolverInfo(
"UpwindType", riemName, "Upwind");
m_riemannSolver = SolverUtils::
GetRiemannSolverFactory().CreateInstance(riemName);
GetRiemannSolverFactory().CreateInstance(
riemName, m_session);
m_riemannSolver->SetScalar(
"Vn", &UnsteadyAdvection::GetNormalVelocity, this);
......
......@@ -108,7 +108,7 @@ namespace Nektar
GetFluxVectorAdv, this);
m_session->LoadSolverInfo("UpwindType", riemName, "Upwind");
m_riemannSolver = SolverUtils::GetRiemannSolverFactory().
CreateInstance(riemName);
CreateInstance(riemName, m_session);
m_riemannSolver->SetScalar("Vn", &UnsteadyAdvectionDiffusion::
GetNormalVelocity, this);
m_advObject->SetRiemannSolver(m_riemannSolver);
......@@ -147,7 +147,7 @@ namespace Nektar
string riemName;
m_session->LoadSolverInfo("UpwindType", riemName, "Upwind");
m_riemannSolver = SolverUtils::GetRiemannSolverFactory().
CreateInstance(riemName);
CreateInstance(riemName, m_session);
m_riemannSolver->SetScalar("Vn",
&UnsteadyAdvectionDiffusion::
GetNormalVelocity, this);
......
......@@ -90,7 +90,7 @@ namespace Nektar
m_advObject->SetFluxVector (&UnsteadyInviscidBurger::GetFluxVector, this);
m_session->LoadSolverInfo("UpwindType", riemName, "Upwind");
m_riemannSolver = SolverUtils::GetRiemannSolverFactory().CreateInstance(riemName);
m_riemannSolver = SolverUtils::GetRiemannSolverFactory().CreateInstance(riemName, m_session);
m_riemannSolver->SetScalar("Vn", &UnsteadyInviscidBurger::GetNormalVelocity, this);
m_advObject->SetRiemannSolver(m_riemannSolver);
......
......@@ -103,7 +103,7 @@ namespace Nektar
GetFluxVectorAdv, this);
m_session->LoadSolverInfo("UpwindType", riemName, "Upwind");
m_riemannSolver = SolverUtils::GetRiemannSolverFactory().
CreateInstance(riemName);
CreateInstance(riemName, m_session);
m_advObject->SetRiemannSolver(m_riemannSolver);
m_advObject->InitObject (m_session, m_fields);
......
......@@ -169,7 +169,7 @@ void APE::v_InitObject()
string riemName;
m_session->LoadSolverInfo("UpwindType", riemName, "APEUpwind");
m_riemannSolver = SolverUtils::GetRiemannSolverFactory().CreateInstance(
riemName);
riemName, m_session);
m_riemannSolver->SetVector("N", &APE::GetNormals, this);
m_riemannSolver->SetVector("basefield", &APE::GetBfTrace, this);
m_riemannSolver->SetAuxVec("vecLocs", &APE::GetVecLocs, this);
......
......@@ -44,8 +44,9 @@ namespace Nektar
/**
*
*/
APESolver::APESolver() :
RiemannSolver()
APESolver::APESolver(
const LibUtilities::SessionReaderSharedPtr& pSession) :
RiemannSolver(pSession)
{
m_requiresRotation = true;
}
......
......@@ -48,7 +48,8 @@ namespace Nektar
class APESolver : public RiemannSolver
{
protected:
APESolver();
APESolver(
const LibUtilities::SessionReaderSharedPtr& pSession);
virtual void v_Solve(
const int nDim,
......
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