Commit 14913b44 authored by Alessandro Bolis's avatar Alessandro Bolis
Browse files

Moved Inc-Navier-Stokes 3DH1D to use always wave space integration to minimise

number of FFTs. Romoved useless regression tests.


git-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@4018 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
parent b046420f
......@@ -297,7 +297,7 @@ namespace Nektar
// necessary to perform to HomoBwdTrans for the fields
// (are complex differently from the base flow)
m_fields[i]->SetWaveSpace(false);
//m_fields[i]->SetWaveSpace(false);
}
}
......@@ -324,7 +324,7 @@ namespace Nektar
// necessary to perform to HomoBwdTrans for the fields
// (are complex differently from the base flow)
m_fields[i]->SetWaveSpace(false);
//m_fields[i]->SetWaveSpace(false);
}
}
// Normal homogeneous 1D
......@@ -339,10 +339,10 @@ namespace Nektar
::AllocateSharedPtr(m_session, BkeyZ, m_LhomZ, m_useFFT, m_dealiasing,
m_graph, m_session->GetVariable(i), m_checkIfSystemSingular[i]);
if(m_MultipleModes)
{
m_fields[i]->SetWaveSpace(false);
}
//if(m_MultipleModes)
//{
// m_fields[i]->SetWaveSpace(false);
//}
}
}
}
......
......@@ -123,9 +123,9 @@ int main(int argc, char* argv[])
Execute("IncNavierStokesSolver","Test_KovaFlow_3DH1D_P5_20modes_MVM.xml","Kovasznay Flow 3D homogeneous 1D, P=5, 20 Fourier modes (MVM)");
Execute("IncNavierStokesSolver","Test_KovaFlow_3DH1D_P5_20modes_SKS_MVM.xml","Kovasznay Flow 3D homogeneous 1D, P=5, 20 Fourier modes - Skew-Symmetric advection(MVM)");
//Test Wave Space Time integration
Execute("IncNavierStokesSolver","Test_WaveSpace_CON.xml","Testing Wave Space time-stepping with Convective advection");
Execute("IncNavierStokesSolver","Test_WaveSpace_SKS.xml","Testing Wave Space time-stepping with Skew-Symmetric advection");
//Test Wave Space Time integration - not required anymore - always wave space for 3DH1D
//Execute("IncNavierStokesSolver","Test_WaveSpace_CON.xml","Testing Wave Space time-stepping with Convective advection");
//Execute("IncNavierStokesSolver","Test_WaveSpace_SKS.xml","Testing Wave Space time-stepping with Skew-Symmetric advection");
//Test of stability basis
Execute("IncNavierStokesSolver","Test_HM.xml","Fourier Half Mode Basis, P=3");
......
<?xml version="1.0" encoding="utf-8"?>
<NEKTAR>
<EXPANSIONS>
<E COMPOSITE="C[0]" NUMMODES="3" FIELDS="u,v,w,p" TYPE="MODIFIED" />
</EXPANSIONS>
<CONDITIONS>
<SOLVERINFO>
<I PROPERTY="SolverType" VALUE="VelocityCorrectionScheme"/>
<I PROPERTY="EQTYPE" VALUE="UnsteadyNavierStokes"/>
<I PROPERTY="AdvectionForm" VALUE="Convective"/>
<I PROPERTY="Projection" VALUE="Galerkin"/>
<I PROPERTY="TimeIntegrationMethod" VALUE="IMEXOrder2"/>
<I PROPERTY="HOMOGENEOUS" VALUE="1D"/>
<I PROPERTY="INTEGRATIONSPACE" VALUE="WAVESPACE"/>
</SOLVERINFO>
<PARAMETERS>
<P> TimeStep = 0.002 </P>
<P> NumSteps = 100 </P>
<P> IO_CheckSteps = 1000 </P>
<P> IO_InfoSteps = 1000 </P>
<P> Kinvis = 1.0 </P>
<P> HomModesZ = 10 </P>
<P> LZ = 1.0 </P>
</PARAMETERS>
<VARIABLES>
<V ID="0"> u </V>
<V ID="1"> v </V>
<V ID="2"> w </V>
<V ID="3"> p </V>
</VARIABLES>
<BOUNDARYREGIONS>
<B ID="0"> C[1] </B>
<B ID="1"> C[2] </B>
<B ID="2"> C[3] </B>
</BOUNDARYREGIONS>
<BOUNDARYCONDITIONS>
<REGION REF="0">
<D VAR="u" VALUE="0" />
<D VAR="v" VALUE="0" />
<D VAR="w" VALUE="0" />
<N VAR="p" USERDEFINEDTYPE="H" VALUE="0" /> // High Order Pressure BC
</REGION>
<REGION REF="1">
<D VAR="u" VALUE="y*(1-y)" />
<D VAR="v" VALUE="0" />
<D VAR="w" VALUE="0" />
<N VAR="p" USERDEFINEDTYPE="H" VALUE="0" /> // High Order Pressure BC
</REGION>
<REGION REF="2">
<N VAR="u" VALUE="0" />
<N VAR="v" VALUE="0" />
<N VAR="w" VALUE="0" />
<D VAR="p" VALUE="0" />
</REGION>
</BOUNDARYCONDITIONS>
<FUNCTION NAME="InitialConditions">
<E VAR="u" VALUE="0" />
<E VAR="v" VALUE="0" />
<E VAR="w" VALUE="0" />
<E VAR="p" VALUE="0" />
</FUNCTION>
<FUNCTION NAME="ExactSolution">
<E VAR="u" VALUE="y*(1-y)" />
<E VAR="v" VALUE="0" />
<E VAR="w" VALUE="0" />
<E VAR="p" VALUE="-2*Kinvis*(x-1)" />
</FUNCTION>
</CONDITIONS>
<GEOMETRY DIM="2" SPACE="2">
<VERTEX>
<!-- Always must have four values per entry. -->
<V ID="0"> 0.0 0.0 0.0 </V>
<V ID="1"> 0.5 0.0 0.0 </V>
<V ID="2"> 1.0 0.0 0.0 </V>
<V ID="3"> 0.0 0.5 0.0 </V>
<V ID="4"> 0.5 0.5 0.0 </V>
<V ID="5"> 1.0 0.5 0.0 </V>
<V ID="6"> 0.0 1.0 0.0 </V>
<V ID="7"> 0.5 1.0 0.0 </V>
<V ID="8"> 1.0 1.0 0.0 </V>
</VERTEX>
<EDGE>
<E ID="0"> 0 1 </E>
<E ID="1"> 1 2 </E>
<E ID="2"> 0 3 </E>
<E ID="3"> 1 4 </E>
<E ID="4"> 2 5 </E>
<E ID="5"> 3 4 </E>
<E ID="6"> 4 5 </E>
<E ID="7"> 3 6 </E>
<E ID="8"> 4 7 </E>
<E ID="9"> 5 8 </E>
<E ID="10"> 6 7 </E>
<E ID="11"> 7 8 </E>
</EDGE>
<!-- Q - quads, T - triangles, S - segments, E - tet, P - pyramid, R - prism, H - hex -->
<!-- Only certain element types are appropriate for the given dimension (dim on mesh) -->
<!-- Can also use faces to define 3-D elements. Specify with F[1] for face 1, for example. -->
<ELEMENT>
<Q ID="0"> 0 3 5 2 </Q>
<Q ID="1"> 1 4 6 3 </Q>
<Q ID="2"> 5 8 10 7 </Q>
<Q ID="3"> 6 9 11 8 </Q>
</ELEMENT>
<COMPOSITE>
<C ID="0"> Q[0-3] </C>
<C ID="1"> E[0,1,10,11] </C> // Walls
<C ID="2"> E[2,7] </C> // Inflow
<C ID="3"> E[4,9] </C> // Outflow
</COMPOSITE>
<DOMAIN> C[0] </DOMAIN>
</GEOMETRY>
</NEKTAR>
<?xml version="1.0" encoding="utf-8"?>
<NEKTAR>
<EXPANSIONS>
<E COMPOSITE="C[0]" NUMMODES="3" FIELDS="u,v,w,p" TYPE="MODIFIED" />
</EXPANSIONS>
<CONDITIONS>
<SOLVERINFO>
<I PROPERTY="SolverType" VALUE="VelocityCorrectionScheme"/>
<I PROPERTY="EQTYPE" VALUE="UnsteadyNavierStokes"/>
<I PROPERTY="EvolutionOperator" VALUE="SkewSymmetric" />
<I PROPERTY="Projection" VALUE="Galerkin"/>
<I PROPERTY="TimeIntegrationMethod" VALUE="IMEXOrder2"/>
<I PROPERTY="HOMOGENEOUS" VALUE="1D"/>
<I PROPERTY="INTEGRATIONSPACE" VALUE="WAVESPACE"/>
</SOLVERINFO>
<PARAMETERS>
<P> TimeStep = 0.002 </P>
<P> NumSteps = 100 </P>
<P> IO_CheckSteps = 1000 </P>
<P> IO_InfoSteps = 1000 </P>
<P> Kinvis = 1.0 </P>
<P> HomModesZ = 10 </P>
<P> LZ = 1.0 </P>
</PARAMETERS>
<VARIABLES>
<V ID="0"> u </V>
<V ID="1"> v </V>
<V ID="2"> w </V>
<V ID="3"> p </V>
</VARIABLES>
<BOUNDARYREGIONS>
<B ID="0"> C[1] </B>
<B ID="1"> C[2] </B>
<B ID="2"> C[3] </B>
</BOUNDARYREGIONS>
<BOUNDARYCONDITIONS>
<REGION REF="0">
<D VAR="u" VALUE="0" />
<D VAR="v" VALUE="0" />
<D VAR="w" VALUE="0" />
<N VAR="p" USERDEFINEDTYPE="H" VALUE="0" /> // High Order Pressure BC
</REGION>
<REGION REF="1">
<D VAR="u" VALUE="y*(1-y)" />
<D VAR="v" VALUE="0" />
<D VAR="w" VALUE="0" />
<N VAR="p" USERDEFINEDTYPE="H" VALUE="0" /> // High Order Pressure BC
</REGION>
<REGION REF="2">
<N VAR="u" VALUE="0" />
<N VAR="v" VALUE="0" />
<N VAR="w" VALUE="0" />
<D VAR="p" VALUE="0" />
</REGION>
</BOUNDARYCONDITIONS>
<FUNCTION NAME="InitialConditions">
<E VAR="u" VALUE="0" />
<E VAR="v" VALUE="0" />
<E VAR="w" VALUE="0" />
<E VAR="p" VALUE="0" />
</FUNCTION>
<FUNCTION NAME="ExactSolution">
<E VAR="u" VALUE="y*(1-y)" />
<E VAR="v" VALUE="0" />
<E VAR="w" VALUE="0" />
<E VAR="p" VALUE="-2*Kinvis*(x-1)" />
</FUNCTION>
</CONDITIONS>
<GEOMETRY DIM="2" SPACE="2">
<VERTEX>
<!-- Always must have four values per entry. -->
<V ID="0"> 0.0 0.0 0.0 </V>
<V ID="1"> 0.5 0.0 0.0 </V>
<V ID="2"> 1.0 0.0 0.0 </V>
<V ID="3"> 0.0 0.5 0.0 </V>
<V ID="4"> 0.5 0.5 0.0 </V>
<V ID="5"> 1.0 0.5 0.0 </V>
<V ID="6"> 0.0 1.0 0.0 </V>
<V ID="7"> 0.5 1.0 0.0 </V>
<V ID="8"> 1.0 1.0 0.0 </V>
</VERTEX>
<EDGE>
<E ID="0"> 0 1 </E>
<E ID="1"> 1 2 </E>
<E ID="2"> 0 3 </E>
<E ID="3"> 1 4 </E>
<E ID="4"> 2 5 </E>
<E ID="5"> 3 4 </E>
<E ID="6"> 4 5 </E>
<E ID="7"> 3 6 </E>
<E ID="8"> 4 7 </E>
<E ID="9"> 5 8 </E>
<E ID="10"> 6 7 </E>
<E ID="11"> 7 8 </E>
</EDGE>
<!-- Q - quads, T - triangles, S - segments, E - tet, P - pyramid, R - prism, H - hex -->
<!-- Only certain element types are appropriate for the given dimension (dim on mesh) -->
<!-- Can also use faces to define 3-D elements. Specify with F[1] for face 1, for example. -->
<ELEMENT>
<Q ID="0"> 0 3 5 2 </Q>
<Q ID="1"> 1 4 6 3 </Q>
<Q ID="2"> 5 8 10 7 </Q>
<Q ID="3"> 6 9 11 8 </Q>
</ELEMENT>
<COMPOSITE>
<C ID="0"> Q[0-3] </C>
<C ID="1"> E[0,1,10,11] </C> // Walls
<C ID="2"> E[2,7] </C> // Inflow
<C ID="3"> E[4,9] </C> // Outflow
</COMPOSITE>
<DOMAIN> C[0] </DOMAIN>
</GEOMETRY>
</NEKTAR>
......@@ -374,27 +374,6 @@ L inf error (variable w) : 8.32667e-16
L 2 error (variable p) : 1.20662e-14
L inf error (variable p) : 4.69775e-14
----------------------------------------
Test_WaveSpace_CON.xml
L 2 error (variable u) : 6.24255e-13
L inf error (variable u) : 3.5823e-12
L 2 error (variable v) : 3.21431e-13
L inf error (variable v) : 1.09954e-12
L 2 error (variable w) : 0
L inf error (variable w) : 8.68163e-18
L 2 error (variable p) : 1.52111e-11
L inf error (variable p) : 3.19814e-11
----------------------------------------
Test_WaveSpace_SKS.xml
L 2 error (variable u) : 6.22491e-13
L inf error (variable u) : 3.59224e-12
L 2 error (variable v) : 3.2548e-13
L inf error (variable v) : 1.11653e-12
L 2 error (variable w) : 0
L inf error (variable w) : 8.69919e-18
L 2 error (variable p) : 1.51638e-11
L inf error (variable p) : 3.21408e-11
----------------------------------------
Test_KovaFlow_SubStep_2order.xml
L 2 error (variable u) : 0.00528173
L inf error (variable u) : 0.0099941
......
......@@ -186,38 +186,38 @@ namespace Nektar
int n_fields = m_fields.num_elements();
static int nchk = 0;
bool integrate_in_wave_space = false;
//bool integrate_in_wave_space = false;
//SingleMode and HalfMode integration must be in wave space
if(m_SingleMode || m_HalfMode)
{
integrate_in_wave_space = true;
}
else if(m_session->DefinesSolverInfo("INTEGRATIONSPACE"))
{
if(m_HomogeneousType == eNotHomogeneous)
{
ASSERTL0(false,"INTEGRATIONSPACE type is meant to be for homogeneous cases");
}
//if(m_SingleMode || m_HalfMode)
//{
// integrate_in_wave_space = true;
//}
//else if(m_session->DefinesSolverInfo("INTEGRATIONSPACE"))
//{
// if(m_HomogeneousType == eNotHomogeneous)
// {
// ASSERTL0(false,"INTEGRATIONSPACE type is meant to be for homogeneous cases");
// }
std::string IntegrationSpaceStr = m_session->GetSolverInfo("INTEGRATIONSPACE");
// std::string IntegrationSpaceStr = m_session->GetSolverInfo("INTEGRATIONSPACE");
if((IntegrationSpaceStr == "WaveSpace") || (IntegrationSpaceStr == "WAVESPACE"))
{
integrate_in_wave_space = true;
}
else if((IntegrationSpaceStr == "RealSpace") || (IntegrationSpaceStr == "REALSPACE"))
{
integrate_in_wave_space = false;
}
else
{
ASSERTL0(false,"INTEGRATIONSPACE type not allowed, try WaveSpace or RealSpace");
}
}
if(integrate_in_wave_space)
// if((IntegrationSpaceStr == "WaveSpace") || (IntegrationSpaceStr == "WAVESPACE"))
// {
// integrate_in_wave_space = true;
// }
// else if((IntegrationSpaceStr == "RealSpace") || (IntegrationSpaceStr == "REALSPACE"))
// {
// integrate_in_wave_space = false;
// }
// else
// {
// ASSERTL0(false,"INTEGRATIONSPACE type not allowed, try WaveSpace or RealSpace");
// }
//}
if(m_HomogeneousType == eHomogeneous1D)
{
for(i = 0; i < n_fields; ++i)
{
......@@ -348,7 +348,7 @@ namespace Nektar
// dump data in m_fields->m_coeffs to file.
if(m_checksteps && n&&(!((n+1)%m_checksteps)))
{
if(integrate_in_wave_space)
if(m_HomogeneousType == eHomogeneous1D)
{
for(i = 0; i< n_fields; i++)
{
......@@ -405,7 +405,7 @@ namespace Nektar
}
}
if(integrate_in_wave_space)
if(m_HomogeneousType == eHomogeneous1D)
{
for(i = 0; i< n_fields; i++)
{
......
......@@ -813,38 +813,38 @@ namespace Nektar
StdRegions::StdExpansion1DSharedPtr Pbc;
Array<OneD, Array< OneD, NekDouble> > velocity(m_nConvectiveFields);
Array<OneD, Array< OneD, NekDouble> > advection(m_nConvectiveFields);
//Array<OneD, Array< OneD, NekDouble> > velocity(m_nConvectiveFields);
//Array<OneD, Array< OneD, NekDouble> > advection(m_nConvectiveFields);
int phystot = m_fields[0]->GetTotPoints();
//int phystot = m_fields[0]->GetTotPoints();
for(int n = 0; n < m_nConvectiveFields; ++n)
{
velocity[n] = Array<OneD, NekDouble> (phystot);
advection[n] = Array<OneD, NekDouble> (phystot);
}
//for(int n = 0; n < m_nConvectiveFields; ++n)
//{
// velocity[n] = Array<OneD, NekDouble> (phystot);
// advection[n] = Array<OneD, NekDouble> (phystot);
//}
for(int i = 0; i < fields.num_elements(); i++)
{
//for(int i = 0; i < fields.num_elements(); i++)
//{
if(m_pressure->GetWaveSpace())
{
velocity[i] = fields[i];
advection[i] = N[i];
}
else
{
m_pressure->HomogeneousFwdTrans(fields[i],velocity[i]);
m_pressure->HomogeneousFwdTrans(N[i],advection[i]);
}
}
// if(m_pressure->GetWaveSpace())
// {
// velocity[i] = fields[i];
// advection[i] = N[i];
// }
// else
// {
// m_pressure->HomogeneousFwdTrans(fields[i],velocity[i]);
// m_pressure->HomogeneousFwdTrans(N[i],advection[i]);
// }
//}
for(int j = 0 ; j < m_HBCnumber ; j++)
{
m_elmt = m_fields[0]->GetExp(m_HBC[0][j]);
U = velocity[m_velocity[0]] + m_HBC[2][j];
V = velocity[m_velocity[1]] + m_HBC[2][j];
W = velocity[m_velocity[2]] + m_HBC[7][j];
U = fields[m_velocity[0]] + m_HBC[2][j];
V = fields[m_velocity[1]] + m_HBC[2][j];
W = fields[m_velocity[2]] + m_HBC[7][j];
m_elmt->PhysDeriv(MultiRegions::DirCartesianMap[0],V,Vx);
m_elmt->PhysDeriv(MultiRegions::DirCartesianMap[1],U,Uy);
......@@ -857,7 +857,7 @@ namespace Nektar
//x-component coming from the other plane
m_elmt->PhysDeriv(MultiRegions::DirCartesianMap[0],Wz,Wxz);
// y-components of vorticity curl
// y-components of vorticity curl
m_elmt->PhysDeriv(MultiRegions::DirCartesianMap[0],Vx,Vxx);
m_elmt->PhysDeriv(MultiRegions::DirCartesianMap[0],Uy,Uxy);
Vmath::Smul(m_HBC[1][j],m_beta[j],V,1,Vzz,1);
......@@ -874,8 +874,8 @@ namespace Nektar
Vmath::Vadd(m_HBC[1][j],Qy,1,Uxy,1,Qy,1);
// getting the advective term
Nu = advection[0] + m_HBC[2][j];
Nv = advection[1] + m_HBC[2][j];
Nu = N[0] + m_HBC[2][j];
Nv = N[1] + m_HBC[2][j];
if(m_subSteppingScheme)
{
......@@ -899,7 +899,7 @@ namespace Nektar
}
Pbc = boost::dynamic_pointer_cast<StdRegions::StdExpansion1D> (PBndExp[m_HBC[5][j]]->GetExp(m_HBC[3][j]));
// Get edge values and put into Uy, Vx
// Get edge values and put into Uy, Vx
m_elmt->GetEdgePhysVals(m_HBC[4][j],Pbc,Qy,Uy);
m_elmt->GetEdgePhysVals(m_HBC[4][j],Pbc,Qx,Vx);
......
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