Commit c976e139 authored by Chris Cantwell's avatar Chris Cantwell

Merge branch 'fix/Mapping' into 'master'

Fix time-integration for VCSMapping

This fixes some inconsistencies in VCSMapping which prevented it from achieving 2nd order accuracy in time.

See merge request !687
parents 0de34198 aa9bcb1d
......@@ -65,6 +65,9 @@ v4.3.4
- Fix compilation with NEKTAR_USE_MESHGEN option
- Fix IterativeFull solver in parallel (!685)
**IncNavierStokesSolver:**
- Fix 2nd order time-integration for VCSMapping (!687)
v4.3.3
------
**Library**:
......
......@@ -75,10 +75,9 @@ namespace Nektar
const Array<OneD, const Array<OneD, NekDouble> > &N,
NekDouble kinvis)
{
m_pressureCalls++;
if(m_HBCdata.num_elements()>0)
{
m_pressureCalls++;
// Rotate HOPBCs storage
RollOver(m_pressureHBCs);
......
......@@ -190,18 +190,6 @@ namespace Nektar
Array<OneD, Array<OneD, NekDouble> > &outarray,
const NekDouble time)
{
// Update mapping and Deal with Dirichlet boundary conditions
if (m_mapping->IsTimeDependent())
{
if (m_mapping->IsFromFunction())
{
// If the transformation is explicitly defined, update it here
// Otherwise, it will be done somewhere else (ForcingMovingBody)
m_mapping->UpdateMapping(time);
}
m_mapping->UpdateBCs(time);
}
EvaluateAdvectionTerms(inarray, outarray);
// Smooth advection
......@@ -221,10 +209,22 @@ namespace Nektar
}
// Add mapping terms
ApplyIncNSMappingForcing( outarray );
ApplyIncNSMappingForcing( inarray, outarray);
// Calculate High-Order pressure boundary conditions
m_extrapolation->EvaluatePressureBCs(inarray,outarray,m_kinvis);
// Update mapping and deal with Dirichlet boundary conditions
if (m_mapping->IsTimeDependent())
{
if (m_mapping->IsFromFunction())
{
// If the transformation is explicitly defined, update it here
// Otherwise, it will be done somewhere else (ForcingMovingBody)
m_mapping->UpdateMapping(time+m_timestep);
}
m_mapping->UpdateBCs(time+m_timestep);
}
}
......@@ -739,6 +739,7 @@ namespace Nektar
* Explicit terms of the mapping
*/
void VCSMapping::ApplyIncNSMappingForcing(
const Array<OneD, const Array<OneD, NekDouble> > &inarray,
Array<OneD, Array<OneD, NekDouble> > &outarray)
{
int physTot = m_fields[0]->GetTotPoints();
......@@ -758,7 +759,7 @@ namespace Nektar
{
for (int i = 0; i < m_nConvectiveFields; ++i)
{
vel[i] = m_fields[i]->GetPhys();
vel[i] = inarray[i];
m_fields[0]->HomogeneousBwdTrans(vel[i],velPhys[i]);
}
}
......@@ -766,8 +767,8 @@ namespace Nektar
{
for (int i = 0; i < m_nConvectiveFields; ++i)
{
vel[i] = m_fields[i]->GetPhys();
Vmath::Vcopy(physTot, m_fields[i]->GetPhys(), 1, velPhys[i], 1);
vel[i] = inarray[i];
Vmath::Vcopy(physTot, inarray[i], 1, velPhys[i], 1);
}
}
......@@ -821,7 +822,7 @@ namespace Nektar
}
void VCSMapping::MappingAdvectionCorrection(
const Array<OneD, Array<OneD, NekDouble> > &velPhys,
const Array<OneD, const Array<OneD, NekDouble> > &velPhys,
Array<OneD, Array<OneD, NekDouble> > &outarray)
{
int physTot = m_fields[0]->GetTotPoints();
......@@ -846,8 +847,8 @@ namespace Nektar
}
void VCSMapping::MappingAccelerationCorrection(
const Array<OneD, Array<OneD, NekDouble> > &vel,
const Array<OneD, Array<OneD, NekDouble> > &velPhys,
const Array<OneD, const Array<OneD, NekDouble> > &vel,
const Array<OneD, const Array<OneD, NekDouble> > &velPhys,
Array<OneD, Array<OneD, NekDouble> > &outarray)
{
int physTot = m_fields[0]->GetTotPoints();
......@@ -952,7 +953,7 @@ namespace Nektar
}
void VCSMapping::MappingViscousCorrection(
const Array<OneD, Array<OneD, NekDouble> > &velPhys,
const Array<OneD, const Array<OneD, NekDouble> > &velPhys,
Array<OneD, Array<OneD, NekDouble> > &outarray)
{
// L(U) - 1.0*d^2(u^i)/dx^jdx^j
......
......@@ -64,6 +64,7 @@ namespace Nektar
//
void ApplyIncNSMappingForcing (
const Array<OneD, const Array<OneD, NekDouble> > &inarray,
Array<OneD, Array<OneD, NekDouble> > &outarray);
virtual ~VCSMapping();
......@@ -123,7 +124,7 @@ namespace Nektar
// Correction needed for convective terms = N(u) - ( -(u \nabla) u)
// velPhys is the velocity field (transformed for physical space)
void MappingAdvectionCorrection(
const Array<OneD, Array<OneD, NekDouble> > &velPhys,
const Array<OneD, const Array<OneD, NekDouble> > &velPhys,
Array<OneD, Array<OneD, NekDouble> > &outarray);
// Correction needed for time-derivative terms
......@@ -131,8 +132,8 @@ namespace Nektar
// vel is the velocity field (can be in wavespace)
// velPhys is the velocity field (transformed for physical space)
void MappingAccelerationCorrection(
const Array<OneD, Array<OneD, NekDouble> > &vel,
const Array<OneD, Array<OneD, NekDouble> > &velPhys,
const Array<OneD, const Array<OneD, NekDouble> > &vel,
const Array<OneD, const Array<OneD, NekDouble> > &velPhys,
Array<OneD, Array<OneD, NekDouble> > &outarray);
// Correction needed for pressure terms
......@@ -146,7 +147,7 @@ namespace Nektar
// vel is the velocity field (can be in wavespace)
// velPhys is the velocity field (transformed for physical space)
void MappingViscousCorrection(
const Array<OneD, Array<OneD, NekDouble> > &velPhys,
const Array<OneD, const Array<OneD, NekDouble> > &velPhys,
Array<OneD, Array<OneD, NekDouble> > &outarray);
};
......
......@@ -10,14 +10,14 @@
<metric type="L2" id="1">
<value variable="u" tolerance="1e-12">55.4979</value>
<value variable="v" tolerance="1e-12">3.73646</value>
<value variable="w" tolerance="1e-12">0.00651591</value>
<value variable="w" tolerance="1e-12">0.00651985</value>
<value variable="p" tolerance="1e-12">167.909</value>
</metric>
<metric type="Linf" id="2">
<value variable="u" tolerance="1e-12">1.44442</value>
<value variable="v" tolerance="1e-12">0.670956</value>
<value variable="w" tolerance="1e-12">0.00447361</value>
<value variable="p" tolerance="1e-12">5.69646</value>
<value variable="v" tolerance="1e-12">0.67092</value>
<value variable="w" tolerance="1e-12">0.00443747</value>
<value variable="p" tolerance="1e-12">5.69644</value>
</metric>
</metrics>
</test>
......@@ -9,13 +9,13 @@
<metrics>
<metric type="L2" id="1">
<value variable="u" tolerance="1e-9">21.4161</value>
<value variable="v" tolerance="1e-9">0.911317</value>
<value variable="p" tolerance="1e-9">1.42587</value>
<value variable="v" tolerance="1e-9">0.911345</value>
<value variable="p" tolerance="1e-9">1.4277</value>
</metric>
<metric type="Linf" id="2">
<value variable="u" tolerance="1e-9">1.87012</value>
<value variable="v" tolerance="1e-9">0.92044</value>
<value variable="p" tolerance="1e-9">1.76508</value>
<value variable="u" tolerance="1e-9">1.87024</value>
<value variable="v" tolerance="1e-9">0.920436</value>
<value variable="p" tolerance="1e-9">1.76557</value>
</metric>
</metrics>
</test>
......
......@@ -17,7 +17,7 @@
<value variable="u" tolerance="1e-9">1.64559e-05</value>
<value variable="v" tolerance="1e-9">2.01086e-07</value>
<value variable="w" tolerance="1e-9">3.48699e-07</value>
<value variable="p" tolerance="1e-9">8.00656e-06</value>
<value variable="p" tolerance="1e-9">8.01151e-06</value>
</metric>
</metrics>
</test>
......@@ -8,16 +8,16 @@
</files>
<metrics>
<metric type="L2" id="1">
<value variable="u" tolerance="1e-9">4.33062e-05</value>
<value variable="v" tolerance="1e-9">1.16121e-05</value>
<value variable="w" tolerance="1e-9">1.29819e-05</value>
<value variable="p" tolerance="1e-9">0.000260747</value>
<value variable="u" tolerance="1e-9">4.33081e-05</value>
<value variable="v" tolerance="1e-9">1.16106e-05</value>
<value variable="w" tolerance="1e-9">1.29757e-05</value>
<value variable="p" tolerance="1e-9">0.000260725</value>
</metric>
<metric type="Linf" id="2">
<value variable="u" tolerance="1e-9">8.96493e-05</value>
<value variable="v" tolerance="1e-9">2.47788e-05</value>
<value variable="w" tolerance="1e-9">2.85904e-05</value>
<value variable="p" tolerance="1e-9">0.000805358</value>
<value variable="u" tolerance="1e-9">8.9668e-05</value>
<value variable="v" tolerance="1e-9">2.47702e-05</value>
<value variable="w" tolerance="1e-9">2.86236e-05</value>
<value variable="p" tolerance="1e-9">0.000805455</value>
</metric>
</metrics>
</test>
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