CigDriver and i have worked out a bit of math a while ago that he uses in his HyperDart and XL-70 Addons. It might be a bit overcomplicated but here goes..
const double boltzmannConst = 5.6704e-8;
const double viscosity0air = 18.27e-6;
const double T0viscosity = 291.15;
const double sutherlandConstAir = 120;
const double PrandlNumberAir = 0.75;
// emissivity of the heatshield
const double emissivity = 0.9;
// heat capacity of the heatshield in J/(K*m^2)
const double heatCapacity = 2357; // 1mm thick Titan
static double hullTemp = 293;
const ATMCONST* atmConsts = oapiGetPlanetAtmConstants(m_pVessel->GetSurfaceRef());
double R = atmConsts->R;
double Ta = this->m_pVessel->GetAtmTemperature();
double gamma = atmConsts->gamma;
double M = this->m_pVessel->GetMachNumber();
double Va = this->m_pVessel->GetAirspeed();
double rho = this->m_pVessel->GetAtmDensity();
double stagnationTemp = (1+((gamma-1)/2)*pow(M,2))*Ta;
double visc = CalcViscosityAir(stagnationTemp);
double Re = rho * Va / visc;
// Nusselt number from Dittus-Boelter equation using Prandl number of air as 0.75 (thus 0.75^0.4 =~ 0.9 for heated airflow)
double Nu = 0.023 * pow(Re, .8) * 0.9;
double alpha = 0.0261 * Nu;
double econv = simdt * alpha * (stagnationTemp - hullTemp); // energy transfered to the heatshield through convection
double erad = simdt * emissivity * boltzmannConst * (pow(hullTemp, 4) - pow(Ta, 4)) ; // energy radiated away from the heatshield, uses ambient air Temp for eyeballing the incoming radiation which is oversimplifying things especially in space but everything else would be much more complicated
double enet = econv - erad; // net energy change in the heatshield
hullTemp = hullTemp + enet/heatCapacity;
sprintf(oapiDebugString(), "hull temp %0.1f alpha %0.1f Re %0.1f Visc %f", hullTemp, alpha, Re, visc);
double CalcViscosityAir(double T)
{
return viscosity0air * (T0viscosity + sutherlandConstAir) / (T + sutherlandConstAir) * pow(T / T0viscosity, 1.5);
}
I'm not sure at all if all this is correct especially seeing that there are a lot of different equations around for calculating the Nusselt number. Also the stagnation temperature is calculated for an ideal gas here which is not adequate especially for reentry conditions where the shockwave temperature is far less than that of an ideal gas because of real gas effects (ionization, chemical equilibrium).
However it gave us results that felt quite right when testing it.