18using namespace helios;
22 wind_speed_default = 1.f;
24 air_temperature_default = 293.f;
26 surface_temperature_default = 303.f;
48 std::vector<uint> UUIDs{UUID};
56 if (strcmp(gH_model,
"Pohlhausen") == 0 || strcmp(gH_model,
"Polhausen") == 0) {
58 }
else if (strcmp(gH_model,
"InclinedPlate") == 0) {
60 }
else if (strcmp(gH_model,
"Sphere") == 0) {
62 }
else if (strcmp(gH_model,
"Ground") == 0) {
65 std::cerr <<
"WARNING (EnergyBalanceModel::setBoundaryLayerModel): Boundary-layer conductance model " << gH_model <<
" is unknown. Skipping this function call.." << std::endl;
69 for (
uint UUID: UUIDs) {
70 boundarylayer_model[UUID] = model;
81 for (
uint UUID: UUIDs) {
87 U = wind_speed_default;
94 Ta = air_temperature_default;
101 T = surface_temperature_default;
130 float gH = calculateBoundaryLayerConductance(boundarylayer_model[UUID], U, L, Nsides, inclination, T, Ta);
136float BLConductanceModel::calculateBoundaryLayerConductance(
uint gH_model,
float U,
float L,
char Nsides,
float inclination,
float TL,
float Ta) {
139 assert(gH_model < 4);
151 gH = 0.135f * sqrt(U / L) * float(Nsides);
153 }
else if (gH_model == 1) {
158 float alpha = nu / Pr;
160 float Re = U * L / nu;
162 float Gr = 9.81f * fabs(TL - Ta) * std::pow(L, 3) / ((Ta) *nu * nu);
165 if (U <= 1e-6f || Re <= 1e-6f) {
168 if (inclination < 75.f * M_PI / 180.f || inclination > 105.f *
M_PI / 180.f) {
170 Nu_free = 0.54f * std::pow(Gr * fabs(cos(inclination)), 0.25f);
173 Nu_free = 0.59f * std::pow(Gr, 0.25f);
175 gH = Nu_free * (alpha / L);
179 float F1 = 0.399f * std::pow(Pr, 1.f / 3.f) * pow(1.f + pow(0.0468f / Pr, 2.f / 3.f), -0.25f);
180 float F2 = 0.75f * std::pow(Pr, 0.5f) * pow(2.5f * (1.f + 2.f * pow(Pr, 0.5f) + 2.f * Pr), -0.25f);
183 float free_direction;
192 if (inclination < 75.f * M_PI / 180.f || inclination > 105.f *
M_PI / 180.f) {
194 gH = 41.4f * alpha / L * 2.f * F1 * sqrtf(Re) * std::pow(1.f + free_direction * std::pow(2.f * F2 * std::pow(Gr * fabs(cos(inclination)) / (Re * Re), 0.25f) / (3.f * F1), 3), 1.f / 3.f);
198 float C = 0.07f * sqrtf(fabs(cos(inclination)));
199 float F3 = std::pow(Pr, 0.5f) * std::pow(0.25f + 1.6f * std::pow(Pr, 0.5f), -1.f) * std::pow(Pr / 5.f, 1.f / 5.f + C);
201 gH = 41.4f * alpha / L * 2.f * F1 * sqrtf(Re) * std::pow(1.f + free_direction * std::pow((F3 * pow(Gr * pow(Re, -5.f / 2.f), 1.f / 5.f) * std::pow(Gr, C)) / (6.f * (1.f / 5.f + C) * F1), 3.f), 1.f / 3.f);
204 }
else if (gH_model == 2) {
213 float Re = U * L / nu;
215 gH = (ka / cp) / L * (2.0 + 0.6 * sqrtf(Re) * pow(Pr, 1.f / 3.f));
217 }
else if (gH_model == 3) {
220 gH = 0.004f + 0.012f * U;