Commit 6d4122fe authored by Daniele de Grazia's avatar Daniele de Grazia Committed by Dave Moxey

Change in DiffusionLDGNS for Penalty term ExtractTracePhys

(cherry picked from commit c01d483a)
parent 2abe1ca6
......@@ -249,11 +249,20 @@ namespace Nektar
fields[i]->GetFwdBwdTracePhys(inarray[i], Fwd[i], Bwd[i]);
fields[0]->GetTrace()->Upwind(Vn, Fwd[i], Bwd[i], numflux[i]);
}
// Extract internal values of the scalar variables for Neumann bcs
Array< OneD, Array<OneD, NekDouble > > uplus(nScalars);
for (i = 0; i < nScalars; ++i)
{
uplus[i] = Array<OneD, NekDouble>(nTracePts, 0.0);
fields[i]->ExtractTracePhys(inarray[i], uplus[i]);
}
// Modify the values in case of boundary interfaces
if (fields[0]->GetBndCondExpansions().num_elements())
{
v_WeakPenaltyO1(fields, inarray, numflux);
v_WeakPenaltyO1(fields, inarray, uplus, numflux);
}
// Splitting the numerical flux into the dimensions
......@@ -273,7 +282,8 @@ namespace Nektar
*/
void DiffusionLDGNS::v_WeakPenaltyO1(
const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
const Array<OneD, Array<OneD, NekDouble> > &inarray,
const Array<OneD, Array<OneD, NekDouble> > &inarray,
const Array<OneD, Array<OneD, NekDouble> > &uplus,
Array<OneD, Array<OneD, NekDouble> > &penaltyfluxO1)
{
int cnt;
......@@ -290,15 +300,15 @@ namespace Nektar
Array<OneD, NekDouble> Tw(nTracePts, m_Twall);
Array< OneD, Array<OneD, NekDouble > > scalarVariables(nScalars);
Array< OneD, Array<OneD, NekDouble > > uplus(nScalars);
//Array< OneD, Array<OneD, NekDouble > > uplus(nScalars);
// Extract internal values of the scalar variables for Neumann bcs
for (i = 0; i < nScalars; ++i)
{
scalarVariables[i] = Array<OneD, NekDouble>(nTracePts, 0.0);
uplus[i] = Array<OneD, NekDouble>(nTracePts, 0.0);
fields[i]->ExtractTracePhys(inarray[i], uplus[i]);
// uplus[i] = Array<OneD, NekDouble>(nTracePts, 0.0);
// fields[i]->ExtractTracePhys(inarray[i], uplus[i]);
}
// Compute boundary conditions for velocities
......@@ -502,6 +512,9 @@ namespace Nektar
Vmath::Svtvp(nTracePts, 1.0, m_traceNormals[i], 1,
Vn, 1, Vn, 1);
}
Array<OneD, NekDouble > qtemp(nTracePts);
// Evaulate Riemann flux
// qflux = \hat{q} \cdot u = q \cdot n
......@@ -520,11 +533,14 @@ namespace Nektar
// Multiply the Riemann flux by the trace normals
Vmath::Vmul(nTracePts, m_traceNormals[j], 1, qfluxtemp, 1,
qfluxtemp, 1);
// Extract the physical values of the solution at the boundaries
fields[i]->ExtractTracePhys(qfield[j][i], qtemp);
// Impose weak boundary condition with flux
if (fields[0]->GetBndCondExpansions().num_elements())
{
v_WeakPenaltyO2(fields, i, j, qfield[j][i], qfluxtemp);
v_WeakPenaltyO2(fields, i, j, qfield[j][i], qtemp, qfluxtemp);
}
// Store the final flux into qflux
......@@ -544,6 +560,7 @@ namespace Nektar
const int var,
const int dir,
const Array<OneD, const NekDouble> &qfield,
const Array<OneD, const NekDouble> &qtemp,
Array<OneD, NekDouble> &penaltyflux)
{
int cnt = 0;
......@@ -555,10 +572,10 @@ namespace Nektar
int nBndRegions = fields[var]->GetBndCondExpansions().num_elements();
Array<OneD, NekDouble > uterm(nTracePts);
Array<OneD, NekDouble > qtemp(nTracePts);
//Array<OneD, NekDouble > qtemp(nTracePts);
// Extract the physical values of the solution at the boundaries
fields[var]->ExtractTracePhys(qfield, qtemp);
//fields[var]->ExtractTracePhys(qfield, qtemp);
// Loop on the boundary regions to apply appropriate bcs
for (i = 0; i < nBndRegions; ++i)
......
......@@ -93,6 +93,7 @@ namespace Nektar
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(
......@@ -106,6 +107,7 @@ namespace Nektar
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(
......
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