Commit 5338b173 authored by Spencer Sherwin's avatar Spencer Sherwin
Browse files

Added better guess for alpha at new step


git-svn-id: https://gforge.sci.utah.edu/svn/nektar/trunk@3771 305cdda6-5ce1-45b3-a98d-dfc68c8b3305
parent 79f2de16
......@@ -68,6 +68,7 @@ namespace Nektar
m_sessionVWI->LoadParameter("EndIteration", m_iterEnd, 0);
m_sessionVWI->LoadParameter("WaveForceMagStep", m_waveForceMagStep,0.01);
m_sessionVWI->LoadParameter("DAlphaDWaveForceMag", m_dAlphaDWaveForceMag,0.0);
m_sessionVWI->LoadParameter("MaxWaveForceMagIter",m_maxWaveForceMagIter,1);
m_sessionVWI->LoadParameter("RollForceScale", m_rollForceScale,1.0);
......@@ -1260,6 +1261,11 @@ cout<<"alpha = "<<m_alpha[0]<<endl;
}
void VortexWaveInteraction::UpdateDAlphaDWaveForceMag(NekDouble alpha_init)
{
m_dAlphaDWaveForceMag = (m_alpha[0]-alpha_init)/m_waveForceMagStep;
}
void VortexWaveInteraction::UpdateAlpha(int outeriter)
{
NekDouble alp_new;
......
......@@ -86,6 +86,9 @@ namespace Nektar
bool CheckIfAtNeutralPoint(void);
void UpdateAlpha(int n);
void UpdateWaveForceMag(int n);
void UpdateDAlphaDWaveForceMag(NekDouble alphainit);
void AppendEvlToFile(std::string file, int n);
void AppendEvlToFile(std::string file, NekDouble WaveForceMag);
......@@ -115,6 +118,11 @@ namespace Nektar
return m_maxOuterIterations;
}
NekDouble GetAlpha(void)
{
return m_alpha[0];
}
NekDouble GetWaveForceMag(void)
{
return m_waveForceMag[0];
......@@ -125,16 +133,27 @@ namespace Nektar
return m_waveForceMagStep;
}
NekDouble GetDAlphaDWaveForceMag(void)
{
return m_dAlphaDWaveForceMag;
}
int GetMaxWaveForceMagIter(void)
{
return m_maxWaveForceMagIter;
}
void SetAlpha(NekDouble alpha)
{
m_alpha[0] = alpha;
}
void SetWaveForceMag(NekDouble mag)
{
m_waveForceMag[0] = mag;
}
bool IfIterInterface(void)
{
return m_iterinterface;
......@@ -172,6 +191,7 @@ namespace Nektar
NekDouble m_neutralPointTol;
NekDouble m_eigRelTol;
NekDouble m_vwiRelaxation;
NekDouble m_dAlphaDWaveForceMag;
bool m_iterinterface;
......
......@@ -63,6 +63,8 @@ int main(int argc, char *argv[])
vwi.AppendEvlToFile("ConvergedSolns",WaveForce);
vwi.SetWaveForceMag(WaveForce + vwi.GetWaveForceMagStep());
vwi.SetAlpha(vwi.GetAlpha() + vwi.GetDAlphaDWaveForceMag()*vwi.GetWaveForceMagStep());
// Save data directories.
if(vwi.GetVWIIterationType() == eFixedAlphaWaveForcing)
{
......@@ -173,6 +175,7 @@ void DoFixedForcingIteration(VortexWaveInteraction &vwi)
int i;
int nouter_iter = vwi.GetNOuterIterations();
bool exit_iteration = false;
NekDouble alpha_init = vwi.GetAlpha();
while(exit_iteration == false)
{
......@@ -221,6 +224,9 @@ void DoFixedForcingIteration(VortexWaveInteraction &vwi)
exit_iteration = true;
}
}
vwi.UpdateDAlphaDWaveForceMag(alpha_init);
}
break;
case eFixedAlphaWaveForcing:
......
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