commit e45d99ac04661e02893ef06a2c2d412048ab4943
parent cb45fb03663f614cf156f2f8a0416f31e5e49c9d
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Wed, 6 Feb 2019 11:33:39 +0100
Upd the boundary_flux_realisation profile
Diffstat:
4 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/src/sdis_Xd_begin.h b/src/sdis_Xd_begin.h
@@ -101,5 +101,5 @@ struct XD(temperature) {
};
static const struct XD(temperature) XD(TEMPERATURE_NULL) = { NULL, 0, 0 };
-#endif /* SDIX_XD_H */
+#endif /* SDIX_<2|3>D_H */
diff --git a/src/sdis_realisation.h b/src/sdis_realisation.h
@@ -24,6 +24,12 @@
struct sdis_scene;
struct ssp_rng;
+enum flux_flag {
+ FLUX_FLAG_CONVECTIVE = BIT(FLUX_CONVECTIVE),
+ FLUX_FLAG_RADIATIVE = BIT(FLUX_RADIATIVE),
+ FLUX_FLAGS_ALL = FLUX_FLAG_CONVECTIVE | FLUX_FLAG_RADIATIVE
+};
+
/*******************************************************************************
* Realisation at a given position and time IN a medium
******************************************************************************/
@@ -91,8 +97,7 @@ boundary_flux_realisation_2d
const double fp_to_meter,
const double ambient_radiative_temperature,
const double reference_temperature,
- const char compute_radiative,
- const char compute_convective,
+ const int flux_mask, /* Combination of enum flux_flag */
double weight[FLUX_NAMES_COUNT__]);
extern LOCAL_SYM res_T
@@ -106,8 +111,7 @@ boundary_flux_realisation_3d
const double fp_to_meter,
const double ambient_radiative_temperature,
const double reference_temperature,
- const char compute_radiative,
- const char compute_convective,
+ const int flux_mask, /* Combination of enum flux_flag */
double weight[FLUX_NAMES_COUNT__]);
/*******************************************************************************
diff --git a/src/sdis_realisation_Xd.h b/src/sdis_realisation_Xd.h
@@ -233,8 +233,7 @@ XD(boundary_flux_realisation)
const double fp_to_meter,
const double Tarad,
const double Tref,
- const char compute_radiative,
- const char compute_convective,
+ const int flux_mask,
double weight[3])
{
struct rwalk_context ctx;
@@ -253,6 +252,8 @@ XD(boundary_flux_realisation)
const enum sdis_side fluid_side =
(solid_side == SDIS_FRONT) ? SDIS_BACK : SDIS_FRONT;
res_T res = RES_OK;
+ const char compute_radiative = (flux_mask & FLUX_FLAG_RADIATIVE) != 0;
+ const char compute_convective = (flux_mask & FLUX_FLAG_CONVECTIVE) != 0;
ASSERT(uv && fp_to_meter > 0 && weight && time >= 0 && Tref >= 0);
#if SDIS_XD_DIMENSION == 2
diff --git a/src/sdis_solve_Xd.h b/src/sdis_solve_Xd.h
@@ -730,6 +730,7 @@ XD(solve_probe_boundary_flux)
const int ithread = omp_get_thread_num();
struct ssp_rng* rng = rngs[ithread];
double time, epsilon, hc, hr;
+ int flux_mask = 0;
if(ATOMIC_GET(&res) != RES_OK) continue; /* An error occurred */
@@ -742,8 +743,11 @@ XD(solve_probe_boundary_flux)
hr = 4.0 * BOLTZMANN_CONSTANT * Tref * Tref * Tref * epsilon;
/* Fluid, Radiative and Solid temperatures */
+ flux_mask = 0;
+ if(hr > 0) flux_mask |= FLUX_FLAG_RADIATIVE;
+ if(hc > 0) flux_mask |= FLUX_FLAG_CONVECTIVE;
res_local = XD(boundary_flux_realisation)(scn, rng, iprim, uv, time,
- solid_side, fp_to_meter, Tarad, Tref, hr>0, hc>0, T_brf);
+ solid_side, fp_to_meter, Tarad, Tref, flux_mask, T_brf);
if(res_local != RES_OK) {
if(res_local != RES_BAD_OP) {
ATOMIC_SET(&res, res_local);
@@ -918,6 +922,7 @@ XD(solve_boundary_flux)
double uv[DIM - 1];
float st[DIM - 1];
double time;
+ int flux_mask = 0;
res_T res_local = RES_OK;
if(ATOMIC_GET(&res) != RES_OK) continue; /* An error occurred */
@@ -969,8 +974,11 @@ XD(solve_boundary_flux)
hr = 4.0 * BOLTZMANN_CONSTANT * Tref * Tref * Tref * epsilon;
/* Fluid, Radiative and Solid temperatures */
+ flux_mask = 0;
+ if(hr > 0) flux_mask |= FLUX_FLAG_RADIATIVE;
+ if(hc > 0) flux_mask |= FLUX_FLAG_CONVECTIVE;
res_local = XD(boundary_flux_realisation)(scn, rng, iprim, uv, time,
- solid_side, fp_to_meter, Tarad, Tref, hr > 0, hc > 0, T_brf);
+ solid_side, fp_to_meter, Tarad, Tref, flux_mask, T_brf);
if(res_local != RES_OK) {
if(res_local != RES_BAD_OP) {
ATOMIC_SET(&res, res_local);