45 fprintf(
ioQQQ,
" Globule distance is negative, internal overflow has occured, sorry.\n" );
46 fprintf(
ioQQQ,
" This is routine lgConvPres, GLBDST is%10.2e\n",
64 fprintf(
ioQQQ,
" PROBLEM WIND called with zero velocity - this is impossible.\n Sorry.\n" );
80 fprintf(
ioQQQ,
" lgConvPres sets AccelGravity %.3e lgDisk?%c\n",
116 fprintf(
ioQQQ,
" lgConvPres new wind V zn%li %.3e AccelTotalOutward %.3e AccelGravity %.3e\n",
127 fprintf(
ioQQQ,
"chDenseLaw==\"WIND\" must now be ballistic or static\n");
196 fprintf(
ioQQQ,
" Insanity, lgConvPres gets chCPres=%4.4s\n",
203 static bool lgWARN2BIG=
false;
207 fprintf(
ioQQQ,
"\n\n >========== Warning! The tabulated or functional change in density as a function of depth was VERY large. This is zone %li.\n",
nzone);
208 fprintf(
ioQQQ,
" >========== Warning! This will cause convergence problems. \n");
209 fprintf(
ioQQQ,
" >========== Warning! The current radius is %.3e. \n",
radius.
Radius);
210 fprintf(
ioQQQ,
" >========== Warning! The current depth is %.3e. \n",
radius.
depth);
211 fprintf(
ioQQQ,
" >========== Warning! Consider using a more modest change in density vs radius. \n\n\n");
224 fprintf(
ioQQQ,
" Unknown density law=%s= This is a major internal error.\n",
279 density_change_factor =
MIN2(density_change_factor,1.+pdelta);
280 density_change_factor =
MAX2(density_change_factor,1.-pdelta);
281 return density_change_factor;
307 enum{DEBUG_LOC=
false};
308 static long int nsave=-1;
314 fprintf(
ioQQQ,
"nnzzone\t%li\t%.2f%%\t%.3f\t%.2e\t%.2e\t%.2e\n",
316 density_change_factor,
328 " PressureChange called, changing HDEN from %10.3e to %10.3e Set fill fac to %10.3e\n",
333 bool lgChange = ( density_change_factor != 1. );
346 enum {DEBUG_LOC=
false};
348 if( DEBUG_LOC && (
nzone>215) )
351 "%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%c\n",
392 double PresTotlCorrect = st.
press;
402 " DynaPresChngFactor set PresTotlCorrect=%.3e PresTotlInit=%.3e PresInteg=%.3e DivergePresInteg=%.3e\n",
408 fprintf(
ioQQQ,
"Pressure: init %g +rad %g +diverge %g = %g cf %g\n",
428 rhohat = densityCurrent - er/dpdrho;
434 double dpdrho = (st.
erp-er)/(st.
dp-densityCurrent);
435 rhohat = densityCurrent - er/dpdrho;
444 rhohat = 1.03*densityCurrent;
448 rhohat = 0.97*densityCurrent;
452 st.
dp = densityCurrent;
457 fprintf(
ioQQQ,
"windv %li r %g v %g f %g\n",
464 " DynaPresChngFactor mode %s new density %.3f vel %.3e\n",
614 printf(
"Need to set global pressure mode\n");
NORETURN void TotalInsanity(void)
#define DEBUG_ENTRY(funcname)
realnum GetDensity(realnum z)
void ScaleAllDensities(realnum factor)
realnum scalingDensity(void)
double dense_tabden(double r0, double depth)
double dense_fabden(double radius, double depth)
double dense_parametric_wind(double rad)
realnum DynaFlux(double depth)
void PresTotCurrent(void)
STATIC bool lgTestPressureConvergence(double new_density)
STATIC void logPressureState()
double pressureZone(const PresMode &presmode)
STATIC double stepDensity(const PresMode &presmode, solverState &st)
STATIC double limitedDensityScaling(double new_density, double dP_chng_factor)
bool PressureChange(double dP_chng_factor, const PresMode &presmode, solverState &st)
bool lgStatic(void) const
realnum AccelTotalOutward
bool lgBallistic(void) const
realnum PressureErrorAllowed
double MaxFractionalDensityStepPerIteration
vector< double > hist_pres_density
vector< double > hist_pres_error
vector< double > hist_pres_current
realnum gas_phase[LIMELM]
double pres_radiation_lines_curr
void TempChange(double TempNew, bool lgForceUpdate)