48using namespace MultiRegions;
90 AdvectionSystem::v_GenerateSummary(s);
92 "Velocity correction Level Set");
108 "Flow rate is not supported in multiphase flows. ");
126 outarray[nvel + 2], aii_Dt);
166 int physTot =
m_fields[nvel]->GetTotPoints();
172 for (i = 0; i < nvel; ++i)
178 for (i = 0; i < nvel; ++i)
185 for (i = 0; i < nvel; ++i)
188 Vmath::Vadd(physTot, gradPhiMag, 1, tmp, 1, gradPhiMag, 1);
191 Vmath::Vabs(physTot, gradPhiMag, 1, gradPhiMag, 1);
193 for (i = 0; i < nvel; ++i)
195 Vmath::Vdiv(physTot, gradPhi[i], 1, gradPhiMag, 1, IntNorm[i], 1);
197 for (
int j = 0; j < physTot; ++j)
199 if (gradPhi[i][j] == 0 || gradPhiMag[j] == 0 ||
200 !std::isfinite(IntNorm[i][j]))
209 for (i = 0; i < nvel; ++i)
212 Vmath::Vadd(physTot, divIntNorm, 1, tmp, 1, divIntNorm, 1);
218 Vmath::Ssub(physTot, 1.0, fields, 1, oneMinusPhi, 1);
219 Vmath::Vmul(physTot, fields, 1, oneMinusPhi, 1, phiOnephiTwo, 1);
225 Vmath::Ssub(physTot, 1.0, twoPhi, 1, oneMinusTwoPhi, 1);
230 for (i = 0; i < nvel; ++i)
232 Vmath::Vmul(physTot, gradPhi[i], 1, IntNorm[i], 1, tmp, 1);
237 Vmath::Vvtvvtp(physTot, phiOnephiTwo, 1, divIntNorm, 1, oneMinusTwoPhi, 1,
254 size_t physTot =
m_fields[0]->GetTotPoints();
264 for (
int i = 0; i < nvel; ++i)
272 for (
int i = 0; i < nvel; ++i)
275 m_fields[nvel]->GetPhys(), gradPhi[i]);
280 for (
int i = 0; i < nvel; ++i)
283 Vmath::Vadd(physTot, gradPhiMag, 1, tmp, 1, gradPhiMag, 1);
287 Vmath::Vabs(physTot, gradPhiMag, 1, gradPhiMag, 1);
288 for (
int i = 0; i < nvel; ++i)
290 Vmath::Vdiv(physTot, gradPhi[i], 1, gradPhiMag, 1, IntNorm[i], 1);
292 for (
int j = 0; j < physTot; ++j)
294 if (gradPhi[i][j] == 0 || gradPhiMag[j] == 0 ||
295 !std::isfinite(IntNorm[i][j]))
303 for (
int i = 0; i < nvel; ++i)
307 Vmath::Vadd(physTot, divIntNorm, 1, tmp, 1, divIntNorm, 1);
313 for (
int i = 0; i < nvel; ++i)
315 Vmath::Vmul(physTot, gradPhi[i], 1, divIntNorm, 1, SurfTen[i], 1);
322 int ncoeffs =
m_fields[0]->GetNcoeffs();
323 for (
int i = 0; i < nvel; ++i)
326 m_fields[nvel]->FwdTrans(SurfTen[i], coeffs);
327 m_fields[nvel]->BwdTrans(coeffs, SurfTen[i]);
334 for (
int i = 0; i < nvel; ++i)
343 for (i = 1; i < nvel; ++i)
362 size_t physTot =
m_fields[0]->GetTotPoints();
397 for (
int i = 0; i < nvel; ++i)
418 for (
int i = 0; i < nvel; ++i)
420 Vmath::Vvtvvtp(physTot, aiiDtInvVisc, 1, inarray[i], 1, InvVisc, 1,
435 int physTot =
m_fields[nvel]->GetTotPoints();
442 varCoeffMap, varFactorsMap);
449 m_fields[nvel + 1]->FwdTransLocalElmt(outarrayRho,
450 m_fields[nvel + 1]->UpdateCoeffs());
456 m_fields[nvel + 2]->FwdTransLocalElmt(outarrayVisc,
457 m_fields[nvel + 2]->UpdateCoeffs());
473 int physTot =
m_fields[nvel + 1]->GetTotPoints();
488 factors, varCoeffMap, varFactorsMap);
513 int physTot =
m_fields[nvel + 2]->GetTotPoints();
523 for (
int i = 0; i < nvel; ++i)
543 factors, varCoeffMap, varFactorsMap);
544 m_fields[i]->UnsetGlobalLinSys(gkey,
true);
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
MultiRegions::ExpListSharedPtr m_pressure
Pointer to field holding pressure field.
ExtrapolateSharedPtr m_extrapolation
Array< OneD, int > m_velocity
int which identifies which components of m_fields contains the velocity (u,v,w);
int m_nConvectiveFields
Number of fields to be convected;.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
static std::string RegisterEnumValue(std::string pEnum, std::string pString, int pEnumValue)
Registers an enumeration value.
void AccumulateRegion(std::string, int iolevel=0)
Accumulate elapsed time for a region.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
Defines a forcing term to be explicitly applied.
Base class for unsteady solvers.
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
void v_SetUpPressureForcing(const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt) override
void SetUpLevelSetForcing(const Array< OneD, NekDouble > &fields, Array< OneD, NekDouble > &Forcing, const NekDouble aii_Dt)
void SolveLevelSet(const Array< OneD, NekDouble > &Forcing, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarrayPhi, Array< OneD, NekDouble > &outarrayRho, Array< OneD, NekDouble > &outarrayVisc, const NekDouble aii_Dt)
void v_SolvePressure(const Array< OneD, NekDouble > &Forcing) override
Array< OneD, Array< OneD, NekDouble > > m_SurfTen
void v_InitObject(bool DeclareField=true) override
Initialisation object for EquationSystem.
static std::string solverTypeLookupId
void v_GenerateSummary(SolverUtils::SummaryList &s) override
Print a summary of time stepping parameters.
void v_SolveUnsteadyStokesSystem(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time, const NekDouble a_iixDt) override
void v_SetUpViscousForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt) override
static std::string className
Name of class.
void v_SolveViscous(const Array< OneD, const Array< OneD, NekDouble > > &Forcing, const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble aii_Dt) override
VCSLevelSet(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
NekDouble m_flowrate
Desired volumetric flowrate.
bool m_useGJPStabilisation
bool to identify if GJP semi-implicit is active.
Array< OneD, Array< OneD, NekDouble > > m_F
void AppendSVVFactors(StdRegions::ConstFactorMap &factors, StdRegions::VarFactorsMap &varFactorsMap)
void SetUpViscousForcing(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt)
void SetUpPressureForcing(const Array< OneD, const Array< OneD, NekDouble > > &fields, Array< OneD, Array< OneD, NekDouble > > &Forcing, const NekDouble aii_Dt)
void SolveViscous(const Array< OneD, const Array< OneD, NekDouble > > &Forcing, const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble aii_Dt)
Array< OneD, NekDouble > m_diffCoeff
Diffusion coefficients (will be kinvis for velocities)
void v_InitObject(bool DeclareField=true) override
Initialisation object for the unsteady diffusion problem.
void SolvePressure(const Array< OneD, NekDouble > &Forcing)
bool m_useGJPNormalVel
bool to identify if GJP normal Velocity should be applied in explicit approach
void ComputeGJPNormalVelocity(const Array< OneD, const Array< OneD, NekDouble > > &inarray, StdRegions::VarCoeffMap &varcoeffs)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
MultiRegions::Direction const DirCartesianMap[]
std::vector< std::pair< std::string, std::string > > SummaryList
EquationSystemFactory & GetEquationSystemFactory()
void AddSummaryItem(SummaryList &l, const std::string &name, const std::string &value)
Adds a summary item to the summary info list.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap
static VarFactorsMap NullVarFactorsMap
std::map< ConstFactorType, NekDouble > ConstFactorMap
static VarCoeffMap NullVarCoeffMap
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
void Ssub(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Substract vector y = alpha - x.
void Svtsvtp(int n, const T alpha, const T *x, int incx, const T beta, const T *y, int incy, T *z, int incz)
Svtsvtp (scalar times vector plus scalar times vector):
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.
void Vabs(int n, const T *x, const int incx, T *y, const int incy)
vabs: y = |x|
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 Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/x.
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
void Zero(int n, T *x, const int incx)
Zero vector.
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
void Vvtvvtp(int n, const T *v, int incv, const T *w, int incw, const T *x, int incx, const T *y, int incy, T *z, int incz)
vvtvvtp (vector times vector plus vector times vector):
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
void Vpow(int n, const T *x, const int incx, const T f, T *y, const int incy)
pow y = pow(x, f)