Regression tests added for both ADRSolver (diffusion operator) and CompressibleFlowSolver (NS). Solved a bug in LDG (Vn instead of m_traceNormals into the Upwind method).
parent 13aa1f16
 ... ... @@ -61,6 +61,7 @@ namespace Nektar const Array > &inarray, Array > &outarray) { //cout<GetCoordim(0); int nPts = fields->GetTotPoints(); ... ... @@ -168,6 +169,13 @@ namespace Nektar } fields->GetTrace()->GetNormals(m_traceNormals); // Get the normal velocity Vn for(i = 0; i < nDim; ++i) { Vmath::Svtvp(nTracePts, 1.0, m_traceNormals[i], 1, Vn, 1, Vn, 1); } // Get the sign of (v \cdot n), v = an arbitrary vector // Evaluate upwind flux: // uflux = \hat{u} \phi \cdot u = u^{(+,-)} n ... ... @@ -186,7 +194,7 @@ namespace Nektar // edge::eForward, if V*n<0 <=> V*n_F<0, pick uflux = uBwd // edge::eBackward, if V*n<0 <=> V*n_B>=0, pick uflux = uBwd fields[i]->GetTrace()->Upwind(m_traceNormals[j], fields[i]->GetTrace()->Upwind(/*m_traceNormals[j]*/Vn, Fwd, Bwd, fluxtemp); // Imposing weak boundary condition with flux ... ... @@ -315,6 +323,13 @@ namespace Nektar } fields->GetTrace()->GetNormals(m_traceNormals); // Get the normal velocity Vn for(i = 0; i < nDim; ++i) { Vmath::Svtvp(nTracePts, 1.0, m_traceNormals[i], 1, Vn, 1, Vn, 1); } // Evaulate upwind flux: // qflux = \hat{q} \cdot u = q \cdot n - C_(11)*(u^+ - u^-) for (i = 0; i < nvariables; ++i) ... ... @@ -337,7 +352,7 @@ namespace Nektar // edge::eBackward, if V*n<0 <=> V*n_B>=0, pick // qflux = qFwd = q+ fields[i]->GetTrace()->Upwind(m_traceNormals[j], fields[i]->GetTrace()->Upwind(/*m_traceNormals[j]*/Vn, qBwd, qFwd, qfluxtemp); ... ...
 ... ... @@ -84,7 +84,7 @@ namespace Nektar const Array > &inarray, Array > &outarray) { cout<GetCoordim(0); int nScalars = inarray.num_elements(); ... ...
 ... ... @@ -35,6 +35,7 @@ #include #include #include #include #include ... ... @@ -768,9 +769,9 @@ namespace Nektar const Array > &inarray, Array > &outarray) { //cout< gmat; Array jac; Array auxArray1, auxArray2, auxArray3; ... ... @@ -802,10 +803,10 @@ namespace Nektar iuFluxO1[i][j] = Array(nTracePts, 0.0); } } // Compute interface numerical fluxes for inarray in physical space v_NumFluxforScalar(fields, inarray, iuFluxO1); switch(nDim) { // 1D problems ... ...
 ... ... @@ -35,6 +35,7 @@ #include #include #include #include #include ... ... @@ -141,13 +142,13 @@ namespace Nektar // Extract the Q factors at each edge point pFields->GetExp(n)->GetEdgeQFactors( 0, auxArray1 = m_Q2D_e0[n]); 0, auxArray1 = m_Q2D_e0[n]); pFields->GetExp(n)->GetEdgeQFactors( 1, auxArray1 = m_Q2D_e1[n]); 1, auxArray1 = m_Q2D_e1[n]); pFields->GetExp(n)->GetEdgeQFactors( 2, auxArray1 = m_Q2D_e2[n]); 2, auxArray1 = m_Q2D_e2[n]); pFields->GetExp(n)->GetEdgeQFactors( 3, auxArray1 = m_Q2D_e3[n]); 3, auxArray1 = m_Q2D_e3[n]); } break; } ... ... @@ -775,7 +776,7 @@ namespace Nektar Array > &outarray) { cout< gmat; ... ... @@ -1001,6 +1002,10 @@ namespace Nektar divFC(nConvectiveFields); Array > > tmp(nConvectiveFields); Array > > tmp1(nConvectiveFields); Array > > tmp2(nConvectiveFields); derivativesO1 = Array >( nScalars); ... ... @@ -1021,8 +1026,9 @@ namespace Nektar nDim); BderivativesO1[i] = Array >( nDim); tmp[i] = Array >( nDim); tmp[i] = Array >(nDim); tmp1[i] = Array >(nDim); tmp2[i] = Array >(nDim); for (j = 0; j < nDim; ++j) { ... ... @@ -1038,7 +1044,147 @@ namespace Nektar Array(nPts, 0.0); tmp[i][j] = Array(nPts, 0.0); tmp1[i][j] = Array(nPts, 0.0); tmp2[i][j] = Array(nPts, 0.0); // Computing the physical first-order discountinuous // derivatives for (n = 0; n < nElements; n++) { // Discontinuous flux nLocalSolutionPts = fields->GetExp(n)-> GetTotPoints(); phys_offset = fields->GetPhys_Offset(n); jac = fields->GetExp(n)->GetGeom2D()-> GetJac(); gmat = fields->GetExp(n)->GetGeom2D()-> GetGmat(); // Temporary vectors Array u1_hat( nLocalSolutionPts, 0.0); Array u2_hat( nLocalSolutionPts, 0.0); switch (j) { case 0: { if (fields->GetExp(n)->GetGeom2D()-> GetGtype() == SpatialDomains::eDeformed) { for (z = 0; z < nLocalSolutionPts; z++) { u1_hat[z] = (inarray[i][z+phys_offset] * gmat[z]) * jac[z]; u2_hat[z] = (inarray[i][z+phys_offset] * gmat[z]) * jac[z]; } } else { for (z = 0; z < nLocalSolutionPts; z++) { u1_hat[z] = (inarray[i][z+phys_offset] * gmat) * jac; u2_hat[z] = (inarray[i][z+phys_offset] * gmat)*jac; } } break; } case 1: { if (fields->GetExp(n)->GetGeom2D()-> GetGtype() == SpatialDomains::eDeformed) { for (z = 0; z < nLocalSolutionPts; z++) { u1_hat[z] = (inarray[i][z+phys_offset] * gmat[z]) * jac[z]; u2_hat[z] = (inarray[i][z+phys_offset] * gmat[z]) * jac[z]; } } else { for (z = 0; z < nLocalSolutionPts; z++) { u1_hat[z] = (inarray[i][z+phys_offset] * gmat) * jac; u2_hat[z] = (inarray[i][z+phys_offset] * gmat)*jac; } } break; } } fields[i]->GetExp(n)->StdPhysDeriv(0, auxArray1 = u1_hat, auxArray2 = tmp1[i][j] + phys_offset); fields[i]->GetExp(n)->StdPhysDeriv(1, auxArray1 = u2_hat, auxArray2 = tmp2[i][j] + phys_offset); } Vmath::Vadd(nPts, auxArray1 = tmp1[i][j], 1, auxArray2 = tmp2[i][j], 1, DinarrayO1[i][j], 1); // Multiply by the metric terms for (n = 0; n < nElements; ++n) { nLocalSolutionPts = fields-> GetExp(n)->GetTotPoints(); phys_offset = fields->GetPhys_Offset(n); jac = fields->GetExp(n)->GetGeom2D()->GetJac(); gmat = fields->GetExp(n)->GetGeom2D()->GetGmat(); if (fields->GetExp(n)->GetGeom2D()-> GetGtype() == SpatialDomains::eDeformed) { for (z = 0; z < nLocalSolutionPts; z++) { DinarrayO1[i][j][phys_offset + z] = DinarrayO1[i][j][phys_offset + z]/jac[z]; } } else { Vmath::Smul(nLocalSolutionPts, 1/jac, auxArray1 = DinarrayO1[i][j] + phys_offset, 1, auxArray2 = DinarrayO1[i][j] + phys_offset, 1); } } /* // Computing the physical first-order discountinuous // derivatives for (n = 0; n < nElements; n++) ... ... @@ -1049,6 +1195,7 @@ namespace Nektar auxArray1 = inarray[i] + phys_offset, auxArray2 = DinarrayO1[i][j] + phys_offset); } */ // Computing the standard first-order correction // derivatives ... ...
 2D unsteady DG explicit diffusion, order 4, P=8 1D unsteady LDG explicit diffusion, order 3, P=2 ADRSolver ExDiffusion_m8.xml ExDiffusion_1D_LDG.xml ExDiffusion_m8.xml ExDiffusion_1D_LDG.xml 0.000337147 0.00196469 0.00279079 0.00925869
 -1.0 0.0 0.0 -0.8 0.0 0.0 -0.6 0.0 0.0 -0.4 0.0 0.0 -0.2 0.0 0.0 0.0 0.0 0.0 0.2 0.0 0.0 0.4 0.0 0.0 0.6 0.0 0.0 0.8 0.0 0.0 1.0 0.0 0.0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 S[0-9] V V C

TimeStep = 0.000001

NumSteps = 100

FinTime = TimeStep * NumSteps

IO_CheckSteps = 100000

IO_InfoSteps = 100000

u C C
 1D unsteady LFRDG explicit diffusion, order 3, P=2 ADRSolver ExDiffusion_1D_LFRDG.xml ExDiffusion_1D_LFRDG.xml 0.00295 0.0137468
 -1.0 0.0 0.0 -0.8 0.0 0.0 -0.6 0.0 0.0 -0.4 0.0 0.0 -0.2 0.0 0.0 0.0 0.0 0.0 0.2 0.0 0.0 0.4 0.0 0.0 0.6 0.0 0.0 0.8 0.0 0.0 1.0 0.0 0.0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 S[0-9] V V C

TimeStep = 0.000001

NumSteps = 100

FinTime = TimeStep * NumSteps

IO_CheckSteps = 100000

IO_InfoSteps = 100000

u C C
 1D unsteady LFRHU explicit diffusion, order 3, P=2 ADRSolver ExDiffusion_1D_LFRHU.xml ExDiffusion_1D_LFRHU.xml 0.00196469 0.00925869