Commit 6a7f4185 authored by Spencer Sherwin's avatar Spencer Sherwin
Browse files

Merge branch 'master' into fix/IterICs

Conflicts:
	solvers/IncNavierStokesSolver/EquationSystems/VelocityCorrectionScheme.cpp
parents 914ecd30 022709f1
......@@ -1093,53 +1093,57 @@ namespace Nektar
for(i = 0; i < m_bndCondExpansions.num_elements(); ++i)
{
m_bndCondExpansions[i]->GetCoords(x0,x1,x2);
if(x2_in != NekConstants::kNekUnsetDouble && x3_in != NekConstants::kNekUnsetDouble)
if(time == 0.0 || m_bndConditions[i]->GetUserDefined() ==
SpatialDomains::eTimeDependent)
{
x1 = x2_in;
x2 = x3_in;
}
if(m_bndConditions[i]->GetBoundaryConditionType()
m_bndCondExpansions[i]->GetCoords(x0,x1,x2);
if(x2_in != NekConstants::kNekUnsetDouble && x3_in != NekConstants::kNekUnsetDouble)
{
x1 = x2_in;
x2 = x3_in;
}
if(m_bndConditions[i]->GetBoundaryConditionType()
== SpatialDomains::eDirichlet)
{
m_bndCondExpansions[i]->SetCoeff(
(boost::static_pointer_cast<SpatialDomains
::DirichletBoundaryCondition>(m_bndConditions[i])
->m_dirichletCondition).Evaluate(x0,x1,x2,time));
}
else if((m_bndConditions[i]->GetBoundaryConditionType() == SpatialDomains::eJunction)||
(m_bndConditions[i]->GetBoundaryConditionType() == SpatialDomains::eBifurcation)||
(m_bndConditions[i]->GetBoundaryConditionType() == SpatialDomains::eMerging))
{
//Do not update this conditions as they will be by the domain-linking Riemann solvers
}
else if(m_bndConditions[i]->GetBoundaryConditionType()
== SpatialDomains::eNeumann)
{
m_bndCondExpansions[i]->SetCoeff(
(boost::static_pointer_cast<SpatialDomains
::NeumannBoundaryCondition>(m_bndConditions[i])
->m_neumannCondition).Evaluate(x0,x1,x2,time));
}
else if(m_bndConditions[i]->GetBoundaryConditionType()
== SpatialDomains::eRobin)
{
m_bndCondExpansions[i]->SetCoeff(
(boost::static_pointer_cast<SpatialDomains
::RobinBoundaryCondition>(m_bndConditions[i])
->m_robinFunction).Evaluate(x0,x1,x2,time));
m_bndCondExpansions[i]->SetPhys(
(boost::static_pointer_cast<SpatialDomains
::RobinBoundaryCondition>(m_bndConditions[i])
{
m_bndCondExpansions[i]->SetCoeff(
(boost::static_pointer_cast<SpatialDomains
::DirichletBoundaryCondition>(m_bndConditions[i])
->m_dirichletCondition).Evaluate(x0,x1,x2,time));
}
else if((m_bndConditions[i]->GetBoundaryConditionType() == SpatialDomains::eJunction)||
(m_bndConditions[i]->GetBoundaryConditionType() == SpatialDomains::eBifurcation)||
(m_bndConditions[i]->GetBoundaryConditionType() == SpatialDomains::eMerging))
{
//Do not update this conditions as they will be by the domain-linking Riemann solvers
}
else if(m_bndConditions[i]->GetBoundaryConditionType()
== SpatialDomains::eNeumann)
{
m_bndCondExpansions[i]->SetCoeff(
(boost::static_pointer_cast<SpatialDomains
::NeumannBoundaryCondition>(m_bndConditions[i])
->m_neumannCondition).Evaluate(x0,x1,x2,time));
}
else if(m_bndConditions[i]->GetBoundaryConditionType()
== SpatialDomains::eRobin)
{
m_bndCondExpansions[i]->SetCoeff(
(boost::static_pointer_cast<SpatialDomains
::RobinBoundaryCondition>(m_bndConditions[i])
->m_robinFunction).Evaluate(x0,x1,x2,time));
m_bndCondExpansions[i]->SetPhys(
(boost::static_pointer_cast<SpatialDomains
::RobinBoundaryCondition>(m_bndConditions[i])
->m_robinPrimitiveCoeff).Evaluate(x0,x1,x2,time));
}
else
{
ASSERTL0(false,"This type of BC not implemented yet");
}
else
{
ASSERTL0(false,"This type of BC not implemented yet");
}
}
}
}
......
......@@ -1547,6 +1547,10 @@ namespace Nektar
* should be evaluated.
* @param bndCondExpansions List of boundary conditions.
* @param bndConditions Information about the boundary conditions.
*
* This will only be undertaken for time dependent
* boundary conditions unless time == 0.0 which is the
* case when the method is called from the constructor.
*/
void DisContField2D::v_EvaluateBoundaryConditions(const NekDouble time,
const NekDouble x2_in,
......
......@@ -1357,64 +1357,68 @@ namespace Nektar
for(i = 0; i < nbnd; ++i)
{
locExpList = m_bndCondExpansions[i];
npoints = locExpList->GetNpoints();
Array<OneD,NekDouble> x0(npoints,0.0);
Array<OneD,NekDouble> x1(npoints,0.0);
Array<OneD,NekDouble> x2(npoints,0.0);
locExpList->GetCoords(x0,x1,x2);
if(m_bndConditions[i]->GetBoundaryConditionType()
== SpatialDomains::eDirichlet)
if(time == 0.0 || m_bndConditions[i]->GetUserDefined() ==
SpatialDomains::eTimeDependent)
{
locExpList = m_bndCondExpansions[i];
npoints = locExpList->GetNpoints();
Array<OneD,NekDouble> x0(npoints,0.0);
Array<OneD,NekDouble> x1(npoints,0.0);
Array<OneD,NekDouble> x2(npoints,0.0);
locExpList->GetCoords(x0,x1,x2);
if(m_bndConditions[i]->GetBoundaryConditionType()
== SpatialDomains::eDirichlet)
{
LibUtilities::Equation condition = boost::static_pointer_cast<
SpatialDomains::DirichletBoundaryCondition >(m_bndConditions[i])->m_dirichletCondition;
SpatialDomains::DirichletBoundaryCondition >(m_bndConditions[i])->m_dirichletCondition;
condition.Evaluate(x0,x1,x2,time,locExpList->UpdatePhys());
locExpList->FwdTrans_BndConstrained(locExpList->GetPhys(),
locExpList->UpdateCoeffs());
}
else if(m_bndConditions[i]->GetBoundaryConditionType()
== SpatialDomains::eNeumann)
{
LibUtilities::Equation condition = boost::static_pointer_cast<
SpatialDomains::NeumannBoundaryCondition
>(m_bndConditions[i])->m_neumannCondition;
condition.Evaluate(x0,x1,x2,time,locExpList->UpdatePhys());
locExpList->IProductWRTBase(locExpList->GetPhys(),
locExpList->UpdateCoeffs());
}
else if(m_bndConditions[i]->GetBoundaryConditionType()
== SpatialDomains::eNeumann)
{
LibUtilities::Equation condition = boost::static_pointer_cast<
SpatialDomains::NeumannBoundaryCondition
>(m_bndConditions[i])->m_neumannCondition;
condition.Evaluate(x0,x1,x2,time,locExpList->UpdatePhys());
locExpList->IProductWRTBase(locExpList->GetPhys(),
locExpList->UpdateCoeffs());
}
else if(m_bndConditions[i]->GetBoundaryConditionType()
== SpatialDomains::eRobin)
{
LibUtilities::Equation condition = boost::static_pointer_cast<
SpatialDomains::RobinBoundaryCondition
>(m_bndConditions[i])->m_robinFunction;
LibUtilities::Equation coeff =
boost::static_pointer_cast<
SpatialDomains::RobinBoundaryCondition
>(m_bndConditions[i])->m_robinPrimitiveCoeff;
condition.Evaluate(x0,x1,x2,time,locExpList->UpdatePhys());
locExpList->IProductWRTBase(locExpList->GetPhys(),
locExpList->UpdateCoeffs());
// put primitive coefficient into the physical space
// storage
coeff.Evaluate(x0,x1,x2,time,
locExpList->UpdatePhys());
}
else
{
ASSERTL0(false,"This type of BC not implemented yet");
}
else if(m_bndConditions[i]->GetBoundaryConditionType()
== SpatialDomains::eRobin)
{
LibUtilities::Equation condition = boost::static_pointer_cast<
SpatialDomains::RobinBoundaryCondition
>(m_bndConditions[i])->m_robinFunction;
LibUtilities::Equation coeff =
boost::static_pointer_cast<
SpatialDomains::RobinBoundaryCondition
>(m_bndConditions[i])->m_robinPrimitiveCoeff;
condition.Evaluate(x0,x1,x2,time,locExpList->UpdatePhys());
locExpList->IProductWRTBase(locExpList->GetPhys(),
locExpList->UpdateCoeffs());
// put primitive coefficient into the physical space
// storage
coeff.Evaluate(x0,x1,x2,time,
locExpList->UpdatePhys());
}
else
{
ASSERTL0(false,"This type of BC not implemented yet");
}
}
}
}
......
......@@ -204,9 +204,16 @@ namespace Nektar
}
// Fourier transform coefficient space boundary values
// This will only be undertaken for time dependent
// boundary conditions unless time == 0.0 which is the
// case when the method is called from the constructor.
for(n = 0; n < m_bndCondExpansions.num_elements(); ++n)
{
m_bndCondExpansions[n]->HomogeneousFwdTrans(m_bndCondExpansions[n]->GetCoeffs(),m_bndCondExpansions[n]->UpdateCoeffs());
if(time == 0.0 || m_bndConditions[n]->GetUserDefined() ==
SpatialDomains::eTimeDependent)
{
m_bndCondExpansions[n]->HomogeneousFwdTrans(m_bndCondExpansions[n]->GetCoeffs(),m_bndCondExpansions[n]->UpdateCoeffs());
}
}
}
......
......@@ -179,22 +179,26 @@ namespace Nektar
{
int n,m;
const Array<OneD, const NekDouble> y = m_homogeneousBasis_y->GetZ();
const Array<OneD, const NekDouble> y = m_homogeneousBasis_y->GetZ();
const Array<OneD, const NekDouble> z = m_homogeneousBasis_z->GetZ();
for(n = 0; n < m_nz; ++n)
{
for(m = 0; m < m_ny; ++m)
{
m_lines[m+(n*m_ny)]->EvaluateBoundaryConditions(time,0.5*m_lhom_y*(1.0+y[m]),0.5*m_lhom_z*(1.0+z[n]));
}
for(m = 0; m < m_ny; ++m)
{
m_lines[m+(n*m_ny)]->EvaluateBoundaryConditions(time,0.5*m_lhom_y*(1.0+y[m]),0.5*m_lhom_z*(1.0+z[n]));
}
}
// Fourier transform coefficient space boundary values
for(n = 0; n < m_bndCondExpansions.num_elements(); ++n)
{
m_bndCondExpansions[n]->HomogeneousFwdTrans(m_bndCondExpansions[n]->GetCoeffs(),m_bndCondExpansions[n]->UpdateCoeffs());
if(time == 0.0 || m_bndConditions[n]->GetUserDefined() ==
SpatialDomains::eTimeDependent)
{
m_bndCondExpansions[n]->HomogeneousFwdTrans(m_bndCondExpansions[n]->GetCoeffs(),m_bndCondExpansions[n]->UpdateCoeffs());
}
}
}
......
......@@ -244,16 +244,16 @@ namespace Nektar
// Fill z-direction
Array<OneD, const NekDouble> pts = m_homogeneousBasis->GetZ();
Array<OneD, NekDouble> local_pts(m_planes.num_elements());
for(n = 0; n < m_planes.num_elements(); n++)
{
local_pts[n] = pts[m_transposition->GetPlaneID(n)];
}
Array<OneD, NekDouble> local_pts(m_planes.num_elements());
for(n = 0; n < m_planes.num_elements(); n++)
{
local_pts[n] = pts[m_transposition->GetPlaneID(n)];
}
Array<OneD, NekDouble> z(nzplanes);
Vmath::Smul(nzplanes,m_lhom/2.0,local_pts,1,z,1);
Vmath::Sadd(nzplanes,m_lhom/2.0,z,1,z,1);
......
......@@ -89,9 +89,8 @@ namespace Nektar
m_session->MatchSolverInfo("SpectralVanishingViscosity","True",m_useSpecVanVisc,false);
m_session->LoadParameter("SVVCutoffRatio",m_sVVCutoffRatio,0.75);
m_session->LoadParameter("SVVDiffCoeff",m_sVVDiffCoeff,0.1);
m_session->MatchSolverInfo("SpectralVanishingViscosityHomo1D","True",m_useHomo1DSpecVanVisc,false);
if(m_HomogeneousType == eHomogeneous1D)
{
ASSERTL0(m_nConvectiveFields > 2,"Expect to have three velcoity fields with homogenous expansion");
......@@ -374,7 +373,7 @@ namespace Nektar
if(m_useHomo1DSpecVanVisc)
{
cout << "\tSmoothing : Spectral vanishing viscosity (homogeneous1D) " << endl;
cout << "\tSmoothing : Spectral vanishing viscosity (homogeneous1D, cut off ratio = " << m_sVVCutoffRatio << ", diff coeff = "<< m_sVVDiffCoeff << ")"<< endl;
}
}
......
......@@ -35,15 +35,23 @@ int main(int argc, char *argv[])
exit(1);
}
TiXmlElement *nektar = docInput.FirstChildElement("NEKTAR");
// load up root processor's meta data
if(n == 0)
{
TiXmlElement *metadata = nektar->FirstChildElement("FIELDMETADATA");
master->LinkEndChild(new TiXmlElement(*metadata));
}
// load the elements from seperate files.
TiXmlElement *elements = nektar->FirstChildElement("ELEMENTS");
while (elements)
{
master->LinkEndChild(new TiXmlElement(*elements));
elements = elements->NextSiblingElement();
}
}
docOutput.LinkEndChild(master);
if (!docOutput.SaveFile(argv[2]))
{
......
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