Commit dabd9f4a authored by Alessandro Bolis's avatar Alessandro Bolis
Browse files

Added NoAvection class for Unsteady Stokes problem


git-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@4036 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
parent 8c7a7c6a
///////////////////////////////////////////////////////////////////////////////
//
// File NoAdvection.cpp
//
// For more information, please see: http://www.nektar.info
//
// The MIT License
//
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
// Department of Aeronautics, Imperial College London (UK), and Scientific
// Computing and Imaging Institute, University of Utah (USA).
//
// License for the specific language governing rights and limitations under
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Evaluation of the Navier Stokes advective term
//
///////////////////////////////////////////////////////////////////////////////
#include <IncNavierStokesSolver/AdvectionTerms/NoAdvection.h>
#include <cstdio>
#include <cstdlib>
namespace Nektar
{
string NoAdvection::className = GetAdvectionTermFactory().RegisterCreatorFunction("NoAdvection", NoAdvection::create);
/**
* Constructor. Creates ...
*
* \param
* \param
*/
NoAdvection::NoAdvection(const LibUtilities::SessionReaderSharedPtr& pSession,
const SpatialDomains::MeshGraphSharedPtr& pGraph):
AdvectionTerm(pSession, pGraph)
{
}
NoAdvection::~NoAdvection()
{
}
//Advection function
//Evaluation of the advective terms
void NoAdvection::v_ComputeAdvectionTerm(
Array<OneD, MultiRegions::ExpListSharedPtr > &pFields,
const Array<OneD, Array<OneD, NekDouble> > &pV,
const Array<OneD, const NekDouble> &pU,
Array<OneD, NekDouble> &pOutarray,
int pVelocityComponent,
NekDouble m_time,
Array<OneD, NekDouble> &pWk)
{
int nPointsTot = pFields[0]->GetNpoints();
Vmath::Zero(nPointsTot,pOutarray,1);
}
} //end of namespace
///////////////////////////////////////////////////////////////////////////////
//
// File NoAdvection.h
//
// For more information, please see: http://www.nektar.info
//
// The MIT License
//
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
// Department of Aeronautics, Imperial College London (UK), and Scientific
// Computing and Imaging Institute, University of Utah (USA).
//
// License for the specific language governing rights and limitations under
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: NoAdvection
//
///////////////////////////////////////////////////////////////////////////////
#ifndef NEKTAR_SOLVERS_NOADVECTION_H
#define NEKTAR_SOLVERS_NOADVECTION_H
#include <SpatialDomains/MeshComponents.h>
#include <MultiRegions/ContField1D.h>
#include <MultiRegions/ContField2D.h>
#include <MultiRegions/ContField3D.h>
#include <MultiRegions/DisContField1D.h>
#include <MultiRegions/DisContField2D.h>
#include <MultiRegions/ContField3DHomogeneous1D.h>
#include <MultiRegions/DisContField3DHomogeneous1D.h>
#include <MultiRegions/ContField3DHomogeneous2D.h>
#include <MultiRegions/DisContField3DHomogeneous2D.h>
#include <IncNavierStokesSolver/AdvectionTerms/AdvectionTerm.h>
namespace Nektar
{
class NoAdvection: public AdvectionTerm
{
public:
friend class MemoryManager<NoAdvection>;
/// Creates an instance of this class
static AdvectionTermSharedPtr create(
const LibUtilities::SessionReaderSharedPtr& pSession,
const SpatialDomains::MeshGraphSharedPtr& pGraph) {
AdvectionTermSharedPtr p = MemoryManager<NoAdvection>::AllocateSharedPtr(pSession, pGraph);
p->InitObject();
return p;
}
/// Name of class
static std::string className;
protected:
NoAdvection(const LibUtilities::SessionReaderSharedPtr& pSession,
const SpatialDomains::MeshGraphSharedPtr& pGraph);
virtual ~NoAdvection();
private:
//Function for the evaluation of the linearised advective terms
virtual void v_ComputeAdvectionTerm(
Array<OneD, MultiRegions::ExpListSharedPtr > &pFields,
const Array<OneD, Array<OneD, NekDouble> > &pV,
const Array<OneD, const NekDouble> &pU,
Array<OneD, NekDouble> &pOutarray,
int pVelocityComponent,
NekDouble m_time,
Array<OneD, NekDouble> &pWk);
};
} //end of namespace
#endif //NEKTAR_SOLVERS_INCNAVIERSTOKES_H
......@@ -9,6 +9,7 @@ SET(IncNavierStokesSolverSource
./AdvectionTerms/LinearisedAdvection.cpp
./AdvectionTerms/NavierStokesAdvection.cpp
./AdvectionTerms/SkewSymmetricAdvection.cpp
./AdvectionTerms/NoAdvection.cpp
./IncNavierStokesSolver.cpp
)
......
......@@ -162,6 +162,12 @@ namespace Nektar
}
m_advObject = GetAdvectionTermFactory().CreateInstance(vConvectiveType, m_session, m_graph);
}
if(m_equationType == eUnsteadyStokes)
{
std::string vConvectiveType = "NoAdvection";
m_advObject = GetAdvectionTermFactory().CreateInstance(vConvectiveType, m_session, m_graph);
}
#if 0 // Not required if building on an UnsteadySystem rather than an EquationSystem
// Set up filters
......
......@@ -73,8 +73,8 @@ namespace Nektar
"UnsteadyStokes",
"UnsteadyLinearisedNS",
"UnsteadyNavierStokes",
"SteadyNavierStokes",
"SteadyNavierStokesBySFD"
"SteadyNavierStokes",
"SteadyNavierStokesBySFD"
};
......@@ -86,6 +86,7 @@ namespace Nektar
eLinearised,
eAdjoint,
eSkewSymmetric,
eNoAdvection,
eAdvectionFormSize
};
......@@ -98,6 +99,7 @@ namespace Nektar
"Linearised",
"Adjoint",
"SkewSymmetric"
"NoAdvection"
};
/**
......@@ -132,7 +134,8 @@ namespace Nektar
// Sub-stepping related methods
void SubStepAdvection (const Array<OneD, const Array<OneD, NekDouble> > &inarray, Array<OneD, Array<OneD, NekDouble> > &outarray,
void SubStepAdvection (const Array<OneD, const Array<OneD, NekDouble> > &inarray,
Array<OneD, Array<OneD, NekDouble> > &outarray,
const NekDouble time);
void SubStepProjection(const Array<OneD, const Array<OneD, NekDouble> > &inarray,
......@@ -242,8 +245,6 @@ namespace Nektar
ASSERTL0(false,"This method is not defined in this class");
}
private:
};
......
......@@ -472,9 +472,12 @@ namespace Nektar
Array<OneD, Array<OneD, NekDouble> > &outarray,
const NekDouble time)
{
int nqtot = m_fields[0]->GetTotPoints();
// evaluate convection terms
m_advObject->DoAdvection(m_fields, m_nConvectiveFields, m_velocity,inarray,outarray,m_time);
//add the force
m_advObject->DoAdvection(m_fields, m_nConvectiveFields, m_velocity,inarray,outarray,m_time);
//add the force
if(m_session->DefinesFunction("BodyForce"))
{
if(m_SingleMode || m_HalfMode)
......@@ -485,8 +488,6 @@ namespace Nektar
m_forces[i]->BwdTrans(m_forces[i]->GetCoeffs(),m_forces[i]->UpdatePhys());
}
}
int nqtot = m_fields[0]->GetTotPoints();
for(int i = 0; i < m_nConvectiveFields; ++i)
{
Vmath::Vadd(nqtot,outarray[i],1,(m_forces[i]->GetPhys()),1,outarray[i],1);
......
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