hstop.cpp File Reference
#include "SilbertPeriodic.h"

Classes

class  SilbertHstop
 

Functions

bool PointIsAboveCurve (Mdouble h, Mdouble a, int study_num)
 
void HstopCurve (int study_num)
 
int main (int argc, char *argv[])
 

Variables

fstream ReportFile
 

Function Documentation

◆ HstopCurve()

void HstopCurve ( int  study_num)
115 {
116  Mdouble hStart = 4; //height at which bisection algorithm starts
117  Mdouble aStart = 21; //angle at which bisection algorithm starts
118 
119  Mdouble hMax = 60; //height at which bisection algorithm stops
120  Mdouble dh = 2; //how much I decrease the height after a point is found
121  Mdouble da = .5; // how exact I want the angle to be determined
122  Mdouble daMax = 1; //how much (in absolute) I increase the angle if the chute still stops
123 
124  stringstream name;
125  name << "Report" << study_num;
126  ReportFile.open(name.str().c_str(),fstream::out);
127  ReportFile << "height\tangle\tlambda\tmu\tabovemuBottom\tabove\n";
128 
129  //we start at (aStart,hStart) and find the largest non-flowing angle for hStart
130  //first we search in large steps daMax
131 
132  //find a flowing angle aMax and stopping angle aMin
133  Mdouble aMax = aStart;
134  while(!PointIsAboveCurve(hStart,aMax,study_num)) aMax+=daMax;
135  Mdouble aMin=aMax-daMax;
136  if (aMax==aStart) while(PointIsAboveCurve(hStart,aMin,study_num)) {aMin-=daMax; aMax-=daMax;}
137  //bisect until aMin is highest stopping angle
138  while (aMax-aMin>da*1.99) {
139  Mdouble a=(aMin+aMax)/2;
140  if (PointIsAboveCurve(hStart,a,study_num)) aMax=a;
141  else aMin=a;
142  }
143  //now increase height gradually; decrease angle if flow starts
144  Mdouble a = aMin;
145  for (Mdouble h=hStart+dh; h<hMax; h+=dh) {
146  while (PointIsAboveCurve(h,a,study_num)) a-=da;
147  }
148 
149  ReportFile.close();
150  return;
151 }
bool PointIsAboveCurve(Mdouble h, Mdouble a, int study_num)
Definition: hstop.cpp:90
fstream ReportFile
Definition: hstop.cpp:88
const Scalar * a
Definition: level2_cplx_impl.h:32
string name
Definition: plotDoE.py:33
std::ofstream out("Result.txt")

References a, plotDoE::name, out(), PointIsAboveCurve(), and ReportFile.

Referenced by main().

◆ main()

int main ( int argc  ,
char argv[] 
)
154 {
155  if (argc>1) HstopCurve(atoi(argv[1]));
156  else exit(-1);
157 }
void HstopCurve(int study_num)
Definition: hstop.cpp:114

References HstopCurve().

◆ PointIsAboveCurve()

bool PointIsAboveCurve ( Mdouble  h,
Mdouble  a,
int  study_num 
)
90  {
92  problem.setInflowHeight(h) ;
93  problem.setChuteAngle(a);
94  problem.set_study(study_num);
95  stringstream name;
96  name << "H" << problem.getInflowHeight()
97  << "A" << problem.getChuteAngleDegrees()
98  << "L" << round(100.*problem.getFixedParticleRadius()*2.)/100.
99  << "M" << problem.getSlidingFrictionCoefficient()
100  << "B" << problem.getSlidingFrictionCoefficientBottom();
101  problem.setName(name.str().c_str());
102  problem.solve();
103  stringstream com;
104  ReportFile << problem.getInflowHeight()
105  << "\t" << problem.getChuteAngleDegrees()
106  << "\t" << round(100.*problem.getFixedParticleRadius()*2.)/100.
107  << "\t" << problem.getSlidingFrictionCoefficient()
108  << "\t" << problem.getSlidingFrictionCoefficientBottom()
109  << "\t" << problem.pointIsAboveCurve
110  << endl;
111  return problem.pointIsAboveCurve;
112 }
Definition: hstop_StudyHeightHmaxAngle.cpp:12
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 round(const bfloat16 &a)
Definition: BFloat16.h:646
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References a, plotDoE::name, problem, ReportFile, and Eigen::bfloat16_impl::round().

Referenced by HstopCurve().

Variable Documentation

◆ ReportFile

fstream ReportFile

Referenced by HstopCurve(), and PointIsAboveCurve().