1 #ifndef __CS_CONVECTION_DIFFUSION_H__ 2 #define __CS_CONVECTION_DIFFUSION_H__ 102 if (m->
halo != NULL) {
123 cs_get_v_slope_test(
int f_id,
126 const int iconvp = var_cal_opt.
iconv;
127 const int isstpp = var_cal_opt.
isstpc;
128 const double blencp = var_cal_opt.
blencv;
132 if (f_id > -1 && iconvp > 0 && blencp > 0. && isstpp == 0) {
134 static int _k_slope_test_f_id = -1;
138 int f_track_slope_test_id = -1;
140 if (_k_slope_test_f_id < 0)
142 if (_k_slope_test_f_id > -1 && isstpp == 0)
145 if (f_track_slope_test_id > -1)
148 if (v_slope_test != NULL) {
150 # pragma omp parallel for 151 for (
cs_lnum_t cell_id = 0; cell_id < n_cells_ext; cell_id++)
152 v_slope_test[cell_id] = 0.;
171 cs_cell_courant_number(
const int f_id,
206 # pragma omp parallel for 207 for (
cs_lnum_t ii = 0; ii < n_cells_ext; ii++) {
215 for (
int g_id = 0; g_id < n_i_groups; g_id++) {
216 # pragma omp parallel for 217 for (
int t_id = 0; t_id < n_i_threads; t_id++) {
218 for (
cs_lnum_t face_id = i_group_index[(t_id*n_i_groups + g_id)*2];
219 face_id < i_group_index[(t_id*n_i_groups + g_id)*2 + 1];
224 cnt =
CS_ABS(i_massflux[face_id])*dt[ii]/vol[ii];
225 courant[ii] =
CS_MAX(courant[ii], cnt);
227 cnt =
CS_ABS(i_massflux[face_id])*dt[jj]/vol[jj];
228 courant[jj] =
CS_MAX(courant[jj], cnt);
235 for (
int g_id = 0; g_id < n_b_groups; g_id++) {
236 # pragma omp parallel for 237 for (
int t_id = 0; t_id < n_b_threads; t_id++) {
238 for (
cs_lnum_t face_id = b_group_index[(t_id*n_b_groups + g_id)*2];
239 face_id < b_group_index[(t_id*n_b_groups + g_id)*2 + 1];
243 cnt =
CS_ABS(b_massflux[face_id])*dt[ii]/vol[ii];
244 courant[ii] =
CS_MAX(courant[ii], cnt);
276 rfc = (nvf_r_f-nvf_r_c)/(1.-nvf_r_c);
278 if (nvf_p_c < beta_m) {
279 nvf_p_f = nvf_p_c*(1.+rfc*(1.-nvf_p_c)/beta_m);
281 r1f = (1.-nvf_r_f)/(1.-nvf_r_c);
283 nvf_p_f = r1f*nvf_p_c+rfc;
289 if (nvf_p_c < (nvf_r_c/3.)) {
290 r1 = nvf_r_f*(1.-3.*nvf_r_c+2.*nvf_r_f);
291 r2 = nvf_r_c*(1.-nvf_r_c);
293 nvf_p_f = nvf_p_c*r1/r2;
294 }
else if (nvf_p_c <= (nvf_r_c*(1.+nvf_r_f-nvf_r_c)/nvf_r_f)) {
295 rfc = (nvf_r_f-nvf_r_c)/(1.-nvf_r_c);
296 r1f = (1.-nvf_r_f)/(1.-nvf_r_c);
298 nvf_p_f = nvf_r_f*(r1f*nvf_p_c/nvf_r_c + rfc);
306 if (nvf_p_c < (3.*nvf_r_c/4.)) {
307 rfc = (nvf_r_f-nvf_r_c)/(1.-nvf_r_c);
309 nvf_p_f = nvf_r_f*(1.+rfc/3.)*nvf_p_c/nvf_r_c;
310 }
else if (nvf_p_c <= (nvf_r_c*(1.+2.*(nvf_r_f-nvf_r_c))/(2.*nvf_r_f-nvf_r_c))) {
311 rfc = (nvf_r_f-nvf_r_c)/(1.-nvf_r_c);
312 r1f = (1.-nvf_r_f)/(1.-nvf_r_c);
314 nvf_p_f = nvf_r_f*(r1f*nvf_p_c/nvf_r_c+rfc);
316 r1f = (1.-nvf_r_f)/(1.-nvf_r_c);
318 nvf_p_f = 1.-.5*r1f*(1.-nvf_p_c);
324 if (nvf_p_c < (nvf_r_c/(2.-nvf_r_c))) {
325 nvf_p_f = (2.*nvf_r_f-nvf_r_c)*nvf_p_c/nvf_r_c;
326 }
else if (nvf_p_c < nvf_r_c) {
327 rfc = (nvf_r_f-nvf_r_c)/(1.-nvf_r_c);
328 r1f = (1.-nvf_r_f)/(1.-nvf_r_c);
330 nvf_p_f = r1f*nvf_p_c+rfc;
331 }
else if (nvf_p_c < (nvf_r_c/nvf_r_f)) {
332 nvf_p_f = nvf_r_f*nvf_p_c/nvf_r_c;
340 if (nvf_p_c < (.5*nvf_r_c)) {
341 nvf_p_f = (2.*nvf_r_f-nvf_r_c)*nvf_p_c/nvf_r_c;
342 }
else if (nvf_p_c < (1.+nvf_r_c-nvf_r_f)) {
343 nvf_p_f = nvf_p_c+nvf_r_f-nvf_r_c;
351 if (nvf_p_c < nvf_r_c) {
352 nvf_p_f = nvf_r_f*nvf_p_c/nvf_r_c;
354 rfc = (nvf_r_f-nvf_r_c)/(1.-nvf_r_c);
355 r1f = (1.-nvf_r_f)/(1.-nvf_r_c);
357 nvf_p_f = r1f*nvf_p_c+rfc;
363 r1 = nvf_r_c*nvf_r_c-nvf_r_f;
364 r2 = nvf_r_c*(nvf_r_c-1.);
365 r3 = nvf_r_f-nvf_r_c;
367 nvf_p_f = nvf_p_c*(r1+r3*nvf_p_c)/r2;
372 b1 = (nvf_r_c-nvf_r_f)*nvf_r_c;
373 b2 = nvf_r_c+nvf_r_f+2.*nvf_r_f*nvf_r_f-4.*nvf_r_f*nvf_r_c;
375 if (nvf_p_c < (b1/b2)) {
376 r1 = -nvf_r_f*(1.-3.*nvf_r_c+2.*nvf_r_f);
377 r2 = nvf_r_c*(nvf_r_c-1.);
379 nvf_p_f = nvf_p_c*r1/r2;
380 }
else if (nvf_p_c < nvf_r_c) {
381 rfc = (nvf_r_f-nvf_r_c)/(1.-nvf_r_c);
382 r1f = (1.-nvf_r_f)/(1.-nvf_r_c);
384 nvf_p_f = r1f*nvf_p_c+rfc;
385 }
else if (nvf_p_c < (nvf_r_c*(1.+nvf_r_f-nvf_r_c)/nvf_r_f)) {
386 rfc = (nvf_r_f-nvf_r_c)/(1.-nvf_r_c);
387 r1f = (1.-nvf_r_f)/(1.-nvf_r_c);
389 nvf_p_f = nvf_r_f*(nvf_p_c*r1f/nvf_r_c+rfc);
397 if (nvf_p_c < (nvf_r_c/nvf_r_f)) {
398 nvf_p_f = nvf_r_f*nvf_p_c/nvf_r_c;
406 r1 = nvf_r_c*nvf_r_f*(nvf_r_f-nvf_r_c);
407 r2 = 2.*nvf_r_c*(1.-nvf_r_c)-nvf_r_f*(1.-nvf_r_f);
409 if (nvf_p_c < (r1/r2)) {
410 nvf_p_f = 2.*nvf_p_c;
411 }
else if (nvf_p_c <= (nvf_r_c*(1.+nvf_r_f-nvf_r_c)/nvf_r_f)) {
412 rfc = (nvf_r_f-nvf_r_c)/(1.-nvf_r_c);
413 r1f = (1.-nvf_r_f)/(1.-nvf_r_c);
415 nvf_p_f = nvf_r_f*(nvf_p_c*r1f/nvf_r_c+rfc);
460 cs_real_t blend, high_order, low_order, ratio;
463 cs_real_t dotp =
CS_ABS(cs_math_3_dot_product(gradv_c, i_face_normal));
464 cs_real_t sgrad = cs_math_3_norm(gradv_c);
465 cs_real_t snorm = cs_math_3_norm(i_face_normal);
471 high_order = 2.*nvf_p_c;
487 blend =
CS_MIN(1., pow(ratio, .5));
491 nvf_p_f = blend*high_order + (1.-blend)*low_order;
494 if (c_courant < .7 && c_courant > .3) {
495 nvf_p_f = nvf_p_f + (nvf_p_f - low_order)*(.7 - c_courant )/.4;
496 }
else if (c_courant >= .7) {
501 if (c_courant <= .3) {
503 }
else if (c_courant <= .6) {
504 high_order =
CS_MIN(1., nvf_p_c/.3);
505 }
else if (c_courant <= .7) {
510 high_order = 10.*( (.7-c_courant)*
CS_MIN(1., nvf_p_c/.3)
511 + (c_courant-.6)*superbee);
531 blend =
CS_MIN(1., pow(ratio, 2.));
535 nvf_p_f = blend*high_order + (1.-blend)*low_order;
554 blend =
CS_MIN(1., pow(ratio, 4.));
558 nvf_p_f = blend*high_order + (1.-blend)*low_order;
602 testi = grdpai[0]*i_face_normal[0]
603 + grdpai[1]*i_face_normal[1]
604 + grdpai[2]*i_face_normal[2];
605 testj = grdpaj[0]*i_face_normal[0]
606 + grdpaj[1]*i_face_normal[1]
607 + grdpaj[2]*i_face_normal[2];
609 *testij = grdpai[0]*grdpaj[0]
610 + grdpai[1]*grdpaj[1]
611 + grdpai[2]*grdpaj[2];
614 dcc = gradi[0]*i_face_normal[0]
615 + gradi[1]*i_face_normal[1]
616 + gradi[2]*i_face_normal[2];
618 ddj = (pj-
pi)/distf *srfan;
620 dcc = gradj[0]*i_face_normal[0]
621 + gradj[1]*i_face_normal[1]
622 + gradj[2]*i_face_normal[2];
623 ddi = (pj-
pi)/distf *srfan;
627 *tesqck = cs_math_sq(dcc) - cs_math_sq(ddi-ddj);
670 for (
int i = 0; i < 3; i++) {
671 *testij += gradsti[i][0]*gradstj[i][0]
672 + gradsti[i][1]*gradstj[i][1]
673 + gradsti[i][2]*gradstj[i][2];
675 testi[i] = gradsti[i][0]*i_face_normal[0]
676 + gradsti[i][1]*i_face_normal[1]
677 + gradsti[i][2]*i_face_normal[2];
678 testj[i] = gradstj[i][0]*i_face_normal[0]
679 + gradstj[i][1]*i_face_normal[1]
680 + gradstj[i][2]*i_face_normal[2];
682 if (i_massflux > 0.) {
683 dcc[i] = gradi[i][0]*i_face_normal[0]
684 + gradi[i][1]*i_face_normal[1]
685 + gradi[i][2]*i_face_normal[2];
687 ddj[i] = (pj[i]-
pi[i])/distf *srfan;
689 dcc[i] = gradj[i][0]*i_face_normal[0]
690 + gradj[i][1]*i_face_normal[1]
691 + gradj[i][2]*i_face_normal[2];
692 ddi[i] = (pj[i]-
pi[i])/distf *srfan;
697 *tesqck = cs_math_3_square_norm(dcc) - cs_math_3_square_distance(ddi, ddj);
741 for (
int ij = 0; ij < 6; ij++) {
742 *testij += gradsti[ij][0]*gradstj[ij][0]
743 + gradsti[ij][1]*gradstj[ij][1]
744 + gradsti[ij][2]*gradstj[ij][2];
745 testi[ij] = gradsti[ij][0]*i_face_normal[0]
746 + gradsti[ij][1]*i_face_normal[1]
747 + gradsti[ij][2]*i_face_normal[2];
748 testj[ij] = gradstj[ij][0]*i_face_normal[0]
749 + gradstj[ij][1]*i_face_normal[1]
750 + gradstj[ij][2]*i_face_normal[2];
752 if (i_massflux > 0.) {
753 dcc[ij] = gradi[ij][0]*i_face_normal[0]
754 + gradi[ij][1]*i_face_normal[1]
755 + gradi[ij][2]*i_face_normal[2];
757 ddj[ij] = (pj[ij]-
pi[ij])/distf *srfan;
760 dcc[ij] = gradj[ij][0]*i_face_normal[0]
761 + gradj[ij][1]*i_face_normal[1]
762 + gradj[ij][2]*i_face_normal[2];
763 ddi[ij] = (pj[ij]-
pi[ij])/distf *srfan;
767 *tesqck += cs_math_sq(dcc[ij]) - cs_math_sq(ddi[ij]-ddj[ij]);
790 cs_i_compute_quantities(
const cs_real_t bldfrp,
802 cs_real_t gradpf[3] = {0.5*(gradi[0] + gradj[0]),
803 0.5*(gradi[1] + gradj[1]),
804 0.5*(gradi[2] + gradj[2])};
807 *recoi = bldfrp*(cs_math_3_dot_product(gradpf, diipf));
808 *recoj = bldfrp*(cs_math_3_dot_product(gradpf, djjpf));
832 cs_i_compute_quantities_vector(
const cs_real_t bldfrp,
848 for (
int isou = 0; isou < 3; isou++) {
850 for (
int jsou = 0; jsou < 3; jsou++)
851 dpvf[jsou] = 0.5*( gradi[isou][jsou]
852 + gradj[isou][jsou]);
856 recoi[isou] = bldfrp*(cs_math_3_dot_product(dpvf, diipf));
857 recoj[isou] = bldfrp*(cs_math_3_dot_product(dpvf, djjpf));
859 pip[isou] =
pi[isou] + recoi[isou];
860 pjp[isou] = pj[isou] + recoj[isou];
884 cs_i_compute_quantities_tensor(
const cs_real_t bldfrp,
900 for (
int isou = 0; isou < 6; isou++) {
902 for (
int jsou = 0; jsou < 3; jsou++)
903 dpvf[jsou] = 0.5*( gradi[isou][jsou]
904 + gradj[isou][jsou]);
908 recoi[isou] = bldfrp*(cs_math_3_dot_product(dpvf, diipf));
909 recoj[isou] = bldfrp*(cs_math_3_dot_product(dpvf, djjpf));
911 pip[isou] =
pi[isou] + recoi[isou];
912 pjp[isou] = pj[isou] + recoj[isou];
936 cs_i_relax_c_val(
const double relaxp,
948 *pir =
pi/relaxp - (1.-relaxp)/relaxp * pia;
949 *pjr = pj/relaxp - (1.-relaxp)/relaxp * pja;
951 *pipr = *pir + recoi;
952 *pjpr = *pjr + recoj;
974 cs_i_relax_c_val_vector(
const double relaxp,
986 for (
int isou = 0; isou < 3; isou++) {
987 pir[isou] =
pi[isou] /relaxp - (1.-relaxp)/relaxp * pia[isou];
988 pjr[isou] = pj[isou] /relaxp - (1.-relaxp)/relaxp * pja[isou];
990 pipr[isou] = pir[isou] + recoi[isou];
991 pjpr[isou] = pjr[isou] + recoj[isou];
1014 cs_i_relax_c_val_tensor(
const cs_real_t relaxp,
1026 for (
int isou = 0; isou < 6; isou++) {
1027 pir[isou] =
pi[isou] /relaxp - (1.-relaxp)/relaxp * pia[isou];
1028 pjr[isou] = pj[isou] /relaxp - (1.-relaxp)/relaxp * pja[isou];
1030 pipr[isou] = pir[isou] + recoi[isou];
1031 pjpr[isou] = pjr[isou] + recoj[isou];
1064 for (
int isou = 0; isou < 3; isou++)
1081 for (
int isou = 0; isou < 6; isou++)
1097 cs_centered_f_val(
const double pnd,
1102 *pf = pnd*pip + (1.-pnd)*pjp;
1117 cs_centered_f_val_vector(
const double pnd,
1122 for (
int isou = 0; isou < 3; isou++)
1123 pf[isou] = pnd*pip[isou] + (1.-pnd)*pjp[isou];
1138 cs_centered_f_val_tensor(
const double pnd,
1143 for (
int isou = 0; isou < 6; isou++)
1144 pf[isou] = pnd*pip[isou] + (1.-pnd)*pjp[isou];
1168 df[0] = i_face_cog[0] - cell_cen[0];
1169 df[1] = i_face_cog[1] - cell_cen[1];
1170 df[2] = i_face_cog[2] - cell_cen[2];
1172 *pf =
p + cs_math_3_dot_product(df, grad);
1196 for (
int jsou = 0; jsou < 3; jsou++)
1197 df[jsou] = i_face_cog[jsou] - cell_cen[jsou];
1199 for (
int isou = 0; isou < 3; isou++) {
1200 pf[isou] =
p[isou] + df[0]*grad[isou][0]
1201 + df[1]*grad[isou][1]
1202 + df[2]*grad[isou][2];
1228 for (
int jsou = 0; jsou < 3; jsou++)
1229 df[jsou] = i_face_cog[jsou] - cell_cen[jsou];
1231 for (
int isou = 0; isou < 6; isou++) {
1232 pf[isou] =
p[isou] + df[0]*grad[isou][0]
1233 + df[1]*grad[isou][1]
1234 + df[2]*grad[isou][2];
1251 cs_blend_f_val(
const double blencp,
1255 *pf = blencp * (*pf) + (1. - blencp) *
p;
1271 cs_blend_f_val_vector(
const double blencp,
1275 for (
int isou = 0; isou < 3; isou++)
1276 pf[isou] = blencp*(pf[isou])+(1.-blencp)*
p[isou];
1292 cs_blend_f_val_tensor(
const double blencp,
1296 for (
int isou = 0; isou < 6; isou++)
1297 pf[isou] = blencp*(pf[isou])+(1.-blencp)*
p[isou];
1324 cs_i_conv_flux(
const int iconvp,
1340 flui = 0.5*(i_massflux + fabs(i_massflux));
1341 fluj = 0.5*(i_massflux - fabs(i_massflux));
1343 fluxij[0] += iconvp*xcppi*(thetap*(flui*pifri + fluj*pjfri) - imasac*i_massflux*
pi);
1344 fluxij[1] += iconvp*xcppj*(thetap*(flui*pifrj + fluj*pjfrj) - imasac*i_massflux*pj);
1368 cs_i_conv_flux_vector(
const int iconvp,
1383 flui = 0.5*(i_massflux + fabs(i_massflux));
1384 fluj = 0.5*(i_massflux - fabs(i_massflux));
1386 for (
int isou = 0; isou < 3; isou++) {
1388 fluxi[isou] += iconvp*( thetap*(flui*pifri[isou] + fluj*pjfri[isou])
1389 - imasac*i_massflux*
pi[isou]);
1390 fluxj[isou] += iconvp*( thetap*(flui*pifrj[isou] + fluj*pjfrj[isou])
1391 - imasac*i_massflux*pj[isou]);
1416 cs_i_conv_flux_tensor(
const int iconvp,
1431 flui = 0.5*(i_massflux + fabs(i_massflux));
1432 fluj = 0.5*(i_massflux - fabs(i_massflux));
1434 for (
int isou = 0; isou < 6; isou++) {
1435 fluxi[isou] += iconvp*( thetap*(flui*pifri[isou] + fluj*pjfri[isou])
1436 - imasac*i_massflux*
pi[isou]);
1437 fluxj[isou] += iconvp*( thetap*(flui*pifrj[isou] + fluj*pjfrj[isou])
1438 - imasac*i_massflux*pj[isou]);
1458 cs_i_diff_flux(
const int idiffp,
1467 fluxij[0] += idiffp*thetap*i_visc*(pipr -pjp);
1468 fluxij[1] += idiffp*thetap*i_visc*(pip -pjpr);
1488 cs_i_diff_flux_vector(
const int idiffp,
1498 for (
int isou = 0; isou < 3; isou++) {
1499 fluxi[isou] += idiffp*thetap*i_visc*(pipr[isou] -pjp[isou]);
1500 fluxj[isou] += idiffp*thetap*i_visc*(pip[isou] -pjpr[isou]);
1521 cs_i_diff_flux_tensor(
const int idiffp,
1531 for (
int isou = 0; isou < 6; isou++) {
1532 fluxi[isou] += idiffp*thetap*i_visc*(pipr[isou] -pjp[isou]);
1533 fluxj[isou] += idiffp*thetap*i_visc*(pip[isou] -pjpr[isou]);
1564 cs_i_cd_steady_upwind(
const cs_real_t bldfrp,
1586 cs_i_compute_quantities(bldfrp,
1598 cs_i_relax_c_val(relaxp,
1612 cs_upwind_f_val(pir,
1616 cs_upwind_f_val(pjr,
1647 cs_i_cd_steady_upwind_vector(
const cs_real_t bldfrp,
1669 cs_i_compute_quantities_vector(bldfrp,
1681 cs_i_relax_c_val_vector(relaxp,
1693 cs_upwind_f_val_vector(
pi,
1695 cs_upwind_f_val_vector(pir,
1697 cs_upwind_f_val_vector(pj,
1699 cs_upwind_f_val_vector(pjr,
1730 cs_i_cd_steady_upwind_tensor(
const cs_real_t bldfrp,
1752 cs_i_compute_quantities_tensor(bldfrp,
1764 cs_i_relax_c_val_tensor(relaxp,
1776 cs_upwind_f_val_tensor(
pi,
1778 cs_upwind_f_val_tensor(pir,
1780 cs_upwind_f_val_tensor(pj,
1782 cs_upwind_f_val_tensor(pjr,
1806 cs_i_cd_unsteady_upwind(
const cs_real_t bldfrp,
1820 cs_i_compute_quantities(bldfrp,
1832 cs_upwind_f_val(
pi, pif);
1833 cs_upwind_f_val(pj, pjf);
1856 cs_i_cd_unsteady_upwind_vector(
const cs_real_t bldfrp,
1870 cs_i_compute_quantities_vector(bldfrp,
1882 cs_upwind_f_val_vector(
pi, pif);
1883 cs_upwind_f_val_vector(pj, pjf);
1906 cs_i_cd_unsteady_upwind_tensor(
const cs_real_t bldfrp,
1920 cs_i_compute_quantities_tensor(bldfrp,
1932 cs_upwind_f_val_tensor(
pi, pif);
1933 cs_upwind_f_val_tensor(pj, pjf);
1975 const double relaxp,
1976 const double blencp,
2003 cs_i_compute_quantities(bldfrp,
2015 cs_i_relax_c_val(relaxp,
2032 cs_centered_f_val(weight,
2036 cs_centered_f_val(weight,
2040 cs_centered_f_val(weight,
2044 cs_centered_f_val(weight,
2049 }
else if (ischcp == 0) {
2054 cs_solu_f_val(cell_ceni,
2059 cs_solu_f_val(cell_ceni,
2064 cs_solu_f_val(cell_cenj,
2069 cs_solu_f_val(cell_cenj,
2080 cs_solu_f_val(cell_ceni,
2085 cs_solu_f_val(cell_ceni,
2090 cs_solu_f_val(cell_cenj,
2095 cs_solu_f_val(cell_cenj,
2106 cs_blend_f_val(blencp,
2109 cs_blend_f_val(blencp,
2112 cs_blend_f_val(blencp,
2115 cs_blend_f_val(blencp,
2154 cs_i_cd_steady_vector(
const cs_real_t bldfrp,
2156 const double relaxp,
2157 const double blencp,
2182 cs_i_compute_quantities_vector(bldfrp,
2194 cs_i_relax_c_val_vector(relaxp,
2211 cs_centered_f_val_vector(weight,
2215 cs_centered_f_val_vector(weight,
2219 cs_centered_f_val_vector(weight,
2223 cs_centered_f_val_vector(weight,
2233 cs_solu_f_val_vector(cell_ceni,
2238 cs_solu_f_val_vector(cell_ceni,
2243 cs_solu_f_val_vector(cell_cenj,
2248 cs_solu_f_val_vector(cell_cenj,
2258 cs_blend_f_val_vector(blencp,
2261 cs_blend_f_val_vector(blencp,
2264 cs_blend_f_val_vector(blencp,
2267 cs_blend_f_val_vector(blencp,
2307 cs_i_cd_steady_tensor(
const cs_real_t bldfrp,
2309 const double relaxp,
2310 const double blencp,
2336 cs_i_compute_quantities_tensor(bldfrp,
2348 cs_i_relax_c_val_tensor(relaxp,
2365 cs_centered_f_val_tensor(weight,
2369 cs_centered_f_val_tensor(weight,
2373 cs_centered_f_val_tensor(weight,
2377 cs_centered_f_val_tensor(weight,
2387 cs_solu_f_val_tensor(cell_ceni,
2392 cs_solu_f_val_tensor(cell_ceni,
2397 cs_solu_f_val_tensor(cell_cenj,
2402 cs_solu_f_val_tensor(cell_cenj,
2413 cs_blend_f_val_tensor(blencp,
2416 cs_blend_f_val_tensor(blencp,
2419 cs_blend_f_val_tensor(blencp,
2422 cs_blend_f_val_tensor(blencp,
2460 cs_i_cd_unsteady(
const cs_real_t bldfrp,
2462 const double blencp,
2484 cs_i_compute_quantities(bldfrp,
2502 cs_centered_f_val(weight,
2506 cs_centered_f_val(weight,
2511 }
else if (ischcp == 0) {
2516 cs_solu_f_val(cell_ceni,
2521 cs_solu_f_val(cell_cenj,
2527 }
else if (ischcp == 3) {
2532 cs_centered_f_val(weight,
2536 cs_centered_f_val(weight,
2546 cs_solu_f_val(cell_ceni,
2551 cs_solu_f_val(cell_cenj,
2557 hybrid_blend_interp =
fmin(hybrid_blend_i,hybrid_blend_j);
2558 *pif = hybrid_blend_interp*(*pif) + (1. - hybrid_blend_interp)*pif_up;
2559 *pjf = hybrid_blend_interp*(*pjf) + (1. - hybrid_blend_interp)*pjf_up;
2566 cs_solu_f_val(cell_ceni,
2571 cs_solu_f_val(cell_cenj,
2583 cs_blend_f_val(blencp,
2586 cs_blend_f_val(blencp,
2620 cs_i_cd_unsteady_vector(
const cs_real_t bldfrp,
2622 const double blencp,
2643 cs_i_compute_quantities_vector(bldfrp,
2660 cs_centered_f_val_vector(weight,
2664 cs_centered_f_val_vector(weight,
2668 }
else if (ischcp == 3) {
2673 cs_centered_f_val_vector(weight,
2677 cs_centered_f_val_vector(weight,
2687 cs_solu_f_val_vector(cell_ceni,
2692 cs_solu_f_val_vector(cell_cenj,
2698 hybrid_blend_interp =
fmin(hybrid_blend_i,hybrid_blend_j);
2699 for (
int isou = 0; isou < 3; isou++) {
2700 pif[isou] = hybrid_blend_interp *pif[isou]
2701 + (1. - hybrid_blend_interp)*pif_up[isou];
2702 pjf[isou] = hybrid_blend_interp *pjf[isou]
2703 + (1. - hybrid_blend_interp)*pjf_up[isou];
2710 cs_solu_f_val_vector(cell_ceni,
2715 cs_solu_f_val_vector(cell_cenj,
2726 cs_blend_f_val_vector(blencp,
2729 cs_blend_f_val_vector(blencp,
2762 cs_i_cd_unsteady_tensor(
const cs_real_t bldfrp,
2764 const double blencp,
2783 cs_i_compute_quantities_tensor(bldfrp,
2800 cs_centered_f_val_tensor(weight,
2804 cs_centered_f_val_tensor(weight,
2814 cs_solu_f_val_tensor(cell_ceni,
2819 cs_solu_f_val_tensor(cell_cenj,
2830 cs_blend_f_val_tensor(blencp,
2833 cs_blend_f_val_tensor(blencp,
2886 cs_i_cd_steady_slope_test(
bool *upwind_switch,
2890 const double relaxp,
2891 const double blencp,
2892 const double blend_st,
2926 *upwind_switch =
false;
2928 cs_i_compute_quantities(bldfrp,
2940 cs_i_relax_c_val(relaxp,
2972 cs_centered_f_val(weight,
2976 cs_centered_f_val(weight,
2980 cs_centered_f_val(weight,
2984 cs_centered_f_val(weight,
2989 }
else if (ischcp == 0) {
2994 cs_solu_f_val(cell_ceni,
2999 cs_solu_f_val(cell_ceni,
3004 cs_solu_f_val(cell_cenj,
3009 cs_solu_f_val(cell_cenj,
3020 cs_solu_f_val(cell_ceni,
3025 cs_solu_f_val(cell_ceni,
3030 cs_solu_f_val(cell_cenj,
3035 cs_solu_f_val(cell_cenj,
3046 if (tesqck <= 0. || testij <= 0.) {
3048 cs_blend_f_val(blend_st,
3051 cs_blend_f_val(blend_st,
3054 cs_blend_f_val(blend_st,
3057 cs_blend_f_val(blend_st,
3061 *upwind_switch =
true;
3069 cs_blend_f_val(blencp,
3072 cs_blend_f_val(blencp,
3075 cs_blend_f_val(blencp,
3078 cs_blend_f_val(blencp,
3086 cs_upwind_f_val(pir,
3090 cs_upwind_f_val(pjr,
3141 cs_i_cd_steady_slope_test_vector(
bool *upwind_switch,
3145 const double relaxp,
3146 const double blencp,
3147 const double blend_st,
3180 cs_i_compute_quantities_vector(bldfrp,
3192 cs_i_relax_c_val_vector(relaxp,
3206 cs_slope_test_vector(
pi,
3219 for (isou = 0; isou < 3; isou++) {
3225 cs_centered_f_val(weight,
3229 cs_centered_f_val(weight,
3233 cs_centered_f_val(weight,
3237 cs_centered_f_val(weight,
3247 cs_solu_f_val(cell_ceni,
3252 cs_solu_f_val(cell_ceni,
3257 cs_solu_f_val(cell_cenj,
3262 cs_solu_f_val(cell_cenj,
3275 if (tesqck <= 0. || testij <= 0.) {
3276 cs_blend_f_val_vector(blend_st,
3279 cs_blend_f_val_vector(blend_st,
3282 cs_blend_f_val_vector(blend_st,
3285 cs_blend_f_val_vector(blend_st,
3289 *upwind_switch =
true;
3295 cs_blend_f_val_vector(blencp,
3298 cs_blend_f_val_vector(blencp,
3301 cs_blend_f_val_vector(blencp,
3304 cs_blend_f_val_vector(blencp,
3310 for (isou = 0; isou < 3; isou++) {
3311 cs_upwind_f_val(
pi[isou],
3313 cs_upwind_f_val(pir[isou],
3315 cs_upwind_f_val(pj[isou],
3317 cs_upwind_f_val(pjr[isou],
3369 cs_i_cd_steady_slope_test_tensor(
bool *upwind_switch,
3373 const double relaxp,
3374 const double blencp,
3375 const double blend_st,
3408 cs_i_compute_quantities_tensor(bldfrp,
3420 cs_i_relax_c_val_tensor(relaxp,
3434 cs_slope_test_tensor(
pi,
3447 for (isou = 0; isou < 6; isou++) {
3453 cs_centered_f_val(weight,
3457 cs_centered_f_val(weight,
3461 cs_centered_f_val(weight,
3465 cs_centered_f_val(weight,
3475 cs_solu_f_val(cell_ceni,
3480 cs_solu_f_val(cell_ceni,
3485 cs_solu_f_val(cell_cenj,
3490 cs_solu_f_val(cell_cenj,
3503 if (tesqck <= 0. || testij <= 0.) {
3505 cs_blend_f_val_tensor(blend_st,
3508 cs_blend_f_val_tensor(blend_st,
3511 cs_blend_f_val_tensor(blend_st,
3514 cs_blend_f_val_tensor(blend_st,
3518 *upwind_switch =
true;
3526 cs_blend_f_val_tensor(blencp,
3529 cs_blend_f_val_tensor(blencp,
3532 cs_blend_f_val_tensor(blencp,
3535 cs_blend_f_val_tensor(blencp,
3541 for (isou = 0; isou < 6; isou++) {
3542 cs_upwind_f_val(
pi[isou],
3544 cs_upwind_f_val(pir[isou],
3546 cs_upwind_f_val(pj[isou],
3548 cs_upwind_f_val(pjr[isou],
3595 cs_i_cd_unsteady_slope_test(
bool *upwind_switch,
3599 const double blencp,
3600 const double blend_st,
3629 *upwind_switch =
false;
3631 cs_i_compute_quantities(bldfrp,
3663 cs_centered_f_val(weight,
3667 cs_centered_f_val(weight,
3672 }
else if (ischcp == 0) {
3677 cs_solu_f_val(cell_ceni,
3682 cs_solu_f_val(cell_cenj,
3693 cs_solu_f_val(cell_ceni,
3698 cs_solu_f_val(cell_cenj,
3709 if (tesqck<=0. || testij<=0.) {
3711 cs_blend_f_val(blend_st,
3714 cs_blend_f_val(blend_st,
3718 *upwind_switch =
true;
3725 cs_blend_f_val(blencp,
3728 cs_blend_f_val(blencp,
3756 cs_central_downwind_cells(
const cs_lnum_t ii,
3762 if (i_massflux >= 0.) {
3825 const cs_real_t dist_du = dist_dc + dist_cu;
3829 const cs_real_t gradc = cs_math_3_dot_product(gradv_c, ndc);
3831 const cs_real_t grad2c = ((p_d - p_c)/dist_dc - gradc)/dist_dc;
3833 cs_real_t p_u = p_c + (grad2c*dist_cu - gradc)*dist_cu;
3837 const cs_real_t nvf_r_f = (dist_fc+dist_cu)/dist_du;
3838 const cs_real_t nvf_r_c = dist_cu/dist_du;
3845 if (
CS_ABS(p_d-p_u) <= _small) {
3849 const cs_real_t nvf_p_c = (p_c - p_u)/(p_d - p_u);
3851 if (nvf_p_c <= 0. || nvf_p_c >= 1.) {
3859 nvf_p_f = cs_nvd_vof_scheme_scalar(limiter,
3867 nvf_p_f = cs_nvd_scheme_scalar(limiter,
3873 *pif = p_u + nvf_p_f*(p_d - p_u);
3876 cs_blend_f_val(
beta,
3923 cs_i_cd_unsteady_slope_test_vector(
bool *upwind_switch,
3927 const double blencp,
3928 const double blend_st,
3953 cs_i_compute_quantities_vector(bldfrp,
3967 cs_slope_test_vector(
pi,
3980 for (
int isou = 0; isou < 3; isou++) {
3986 cs_centered_f_val(weight,
3990 cs_centered_f_val(weight,
4000 cs_solu_f_val(cell_ceni,
4005 cs_solu_f_val(cell_cenj,
4018 if (tesqck <= 0. || testij <= 0.) {
4020 cs_blend_f_val_vector(blend_st,
4023 cs_blend_f_val_vector(blend_st,
4027 *upwind_switch =
true;
4034 cs_blend_f_val_vector(blencp,
4037 cs_blend_f_val_vector(blencp,
4044 for (
int isou = 0; isou < 3; isou++) {
4045 cs_upwind_f_val(
pi[isou],
4047 cs_upwind_f_val(pj[isou],
4093 cs_i_cd_unsteady_slope_test_tensor(
bool *upwind_switch,
4097 const double blencp,
4098 const double blend_st,
4124 cs_i_compute_quantities_tensor(bldfrp,
4138 cs_slope_test_tensor(
pi,
4151 for (isou = 0; isou < 6; isou++) {
4158 cs_centered_f_val(weight,
4162 cs_centered_f_val(weight,
4172 cs_solu_f_val(cell_ceni,
4177 cs_solu_f_val(cell_cenj,
4187 if (tesqck <= 0. || testij <= 0.) {
4192 cs_blend_f_val_tensor(blend_st,
4195 cs_blend_f_val_tensor(blend_st,
4199 *upwind_switch =
true;
4206 cs_blend_f_val_tensor(blencp,
4209 cs_blend_f_val_tensor(blencp,
4216 for (isou = 0; isou < 6; isou++) {
4217 cs_upwind_f_val(
pi[isou],
4219 cs_upwind_f_val(pj[isou],
4242 *recoi = bldfrp * ( gradi[0]*
diipb[0]
4244 + gradi[2]*
diipb[2]);
4264 for (
int isou = 0; isou < 3; isou++) {
4265 recoi[isou] = bldfrp * ( gradi[isou][0]*
diipb[0]
4266 + gradi[isou][1]*
diipb[1]
4267 + gradi[isou][2]*
diipb[2]);
4288 for (
int isou = 0; isou < 6; isou++) {
4289 recoi[isou] = bldfrp * ( gradi[isou][0]*
diipb[0]
4290 + gradi[isou][1]*
diipb[1]
4291 + gradi[isou][2]*
diipb[2]);
4309 cs_b_relax_c_val(
const double relaxp,
4316 *pir =
pi/relaxp - (1.-relaxp)/relaxp*pia;
4317 *pipr = *pir + recoi;
4334 cs_b_relax_c_val_vector(
const double relaxp,
4341 for (
int isou = 0; isou < 3; isou++) {
4342 pir[isou] =
pi[isou]/relaxp - (1.-relaxp)/relaxp*pia[isou];
4343 pipr[isou] = pir[isou] + recoi[isou];
4361 cs_b_relax_c_val_tensor(
const double relaxp,
4368 for (
int isou = 0; isou < 6; isou++) {
4369 pir[isou] =
pi[isou]/relaxp - (1.-relaxp)/relaxp*pia[isou];
4370 pipr[isou] = pir[isou] + recoi[isou];
4401 cs_b_imposed_conv_flux(
int iconvp,
4429 flui = 0.5*(b_massflux +fabs(b_massflux));
4430 fluj = 0.5*(b_massflux -fabs(b_massflux));
4433 pfac = inc*coefap + coefbp*pipr;
4434 *flux += iconvp*xcpp*(thetap*(flui*pir + fluj*pfac) -imasac*( b_massflux*
pi));
4440 pfac = inc*coface + cofbce*pipr;
4441 *flux += iconvp*xcpp*(-imasac*(b_massflux*
pi) + thetap*(pfac));
4471 cs_b_imposed_conv_flux_vector(
int iconvp,
4498 flui = 0.5*(b_massflux +fabs(b_massflux));
4499 fluj = 0.5*(b_massflux -fabs(b_massflux));
4501 for (
int isou = 0; isou < 3; isou++) {
4502 pfac = inc*coefap[isou];
4503 for (
int jsou = 0; jsou < 3; jsou++) {
4504 pfac += coefbp[isou][jsou]*pipr[jsou];
4506 flux[isou] += iconvp*( thetap*(flui*pir[isou] + fluj*pfac)
4507 - imasac*b_massflux*
pi[isou]);
4514 for (
int isou = 0; isou < 3; isou++) {
4515 pfac = inc*coface[isou];
4516 for (
int jsou = 0; jsou < 3; jsou++) {
4517 pfac += cofbce[isou][jsou]*pipr[jsou];
4519 flux[isou] += iconvp*( thetap*pfac
4520 - imasac*b_massflux*
pi[isou]);
4549 cs_b_upwind_flux(
const int iconvp,
4570 flui = 0.5*(b_massflux +fabs(b_massflux));
4571 fluj = 0.5*(b_massflux -fabs(b_massflux));
4574 pfac = inc*coefap + coefbp*pipr;
4575 *flux += iconvp*xcpp*(thetap*(flui*pir + fluj*pfac) -imasac*( b_massflux*
pi));
4601 cs_b_upwind_flux_vector(
const int iconvp,
4621 flui = 0.5*(b_massflux +fabs(b_massflux));
4622 fluj = 0.5*(b_massflux -fabs(b_massflux));
4624 for (
int isou = 0; isou < 3; isou++) {
4625 pfac = inc*coefa[isou];
4626 for (
int jsou = 0; jsou < 3; jsou++) {
4627 pfac += coefb[isou][jsou]*pipr[jsou];
4629 flux[isou] += iconvp*( thetap*(flui*pir[isou] + fluj*pfac)
4630 - imasac*b_massflux*
pi[isou]);
4657 cs_b_upwind_flux_tensor(
const int iconvp,
4677 flui = 0.5*(b_massflux +fabs(b_massflux));
4678 fluj = 0.5*(b_massflux -fabs(b_massflux));
4680 for (
int isou = 0; isou < 6; isou++) {
4681 pfac = inc*coefa[isou];
4682 for (
int jsou = 0; jsou < 6; jsou++) {
4683 pfac += coefb[isou][jsou]*pipr[jsou];
4685 flux[isou] += iconvp*( thetap*(flui*pir[isou] + fluj*pfac)
4686 - imasac*b_massflux*
pi[isou]);
4706 cs_b_diff_flux(
const int idiffp,
4715 cs_real_t pfacd = inc*cofafp + cofbfp*pipr;
4716 *flux += idiffp*thetap*b_visc*pfacd;
4735 cs_b_diff_flux_vector(
const int idiffp,
4745 for (
int isou = 0; isou < 3; isou++) {
4746 pfacd = inc*cofaf[isou];
4747 for (
int jsou = 0; jsou < 3; jsou++) {
4748 pfacd += cofbf[isou][jsou]*pipr[jsou];
4750 flux[isou] += idiffp*thetap*b_visc*pfacd;
4770 cs_b_diff_flux_tensor(
const int idiffp,
4780 for (
int isou = 0; isou < 6; isou++) {
4781 pfacd = inc*cofaf[isou];
4782 for (
int jsou = 0; jsou < 6; jsou++) {
4783 pfacd += cofbf[isou][jsou]*pipr[jsou];
4785 flux[isou] += idiffp*thetap*b_visc*pfacd;
4807 const double relaxp,
4817 cs_b_compute_quantities(
diipb,
4822 cs_b_relax_c_val(relaxp,
4847 cs_b_cd_steady_vector(
const cs_real_t bldfrp,
4848 const double relaxp,
4858 cs_b_compute_quantities_vector(
diipb,
4863 cs_b_relax_c_val_vector(relaxp,
4888 cs_b_cd_steady_tensor(
const cs_real_t bldfrp,
4889 const double relaxp,
4899 cs_b_compute_quantities_tensor(
diipb,
4904 cs_b_relax_c_val_tensor(relaxp,
4926 cs_b_cd_unsteady(
const cs_real_t bldfrp,
4934 cs_b_compute_quantities(
diipb,
4956 cs_b_cd_unsteady_vector(
const cs_real_t bldfrp,
4964 cs_b_compute_quantities_vector(
diipb,
4969 for (
int isou = 0; isou < 3; isou++)
4970 pip[isou] =
pi[isou] + recoi[isou];
4987 cs_b_cd_unsteady_tensor(
const cs_real_t bldfrp,
4995 cs_b_compute_quantities_tensor(
diipb,
5000 for(
int isou = 0; isou< 6; isou++)
5001 pip[isou] =
pi[isou] + recoi[isou];
5018 cs_b_diff_flux_coupling(
int idiffp,
5024 *fluxi += idiffp*b_visc*(
pi - pj);
5041 cs_b_diff_flux_coupling_vector(
int idiffp,
5047 for (
int k = 0;
k < 3;
k++)
5048 fluxi[
k] += idiffp*b_visc*(
pi[
k] - pj[
k]);
5062 const int *
const f_id,
5063 const int *
const init,
5064 const int *
const inc,
5066 const int *
const iccocg,
5067 const int *
const nswrgp,
5068 const int *
const imligp,
5069 const int *
const iphydp,
5070 const int *
const iwgrp,
5071 const int *
const iwarnp,
5094 const int *
const f_id,
5095 const int *
const init,
5096 const int *
const inc,
5098 const int *
const iccocg,
5099 const int *
const nswrgp,
5100 const int *
const imligp,
5101 const int *
const ircflp,
5102 const int *
const iphydp,
5103 const int *
const iwgrp,
5104 const int *
const iwarnp,
5129 const int *
const f_id,
5130 const int *
const init,
5131 const int *
const inc,
5133 const int *
const iccocg,
5134 const int *
const nswrgp,
5135 const int *
const imligp,
5136 const int *
const iphydp,
5137 const int *
const iwgrp,
5138 const int *
const iwarnp,
5160 const int *
const f_id,
5161 const int *
const init,
5162 const int *
const inc,
5164 const int *
const iccocg,
5165 const int *
const nswrgp,
5166 const int *
const imligp,
5167 const int *
const ircflp,
5168 const int *
const iphydp,
5169 const int *
const iwgrp,
5170 const int *
const iwarnp,
Definition: cs_field_pointer.h:70
void itrgrv(const int *const f_id, const int *const init, const int *const inc, const int *const imrgra, const int *const iccocg, const int *const nswrgp, const int *const imligp, const int *const ircflp, const int *const iphydp, const int *const iwgrp, const int *const iwarnp, const cs_real_t *const epsrgp, const cs_real_t *const climgp, const cs_real_t *const extrap, cs_real_3_t frcxt[], cs_real_t pvar[], const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t cofafp[], const cs_real_t cofbfp[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t viscel[], const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_t diverg[])
Definition: cs_convection_diffusion.c:807
void cs_convection_diffusion_vector(int idtvar, int f_id, const cs_var_cal_opt_t var_cal_opt, int icvflb, int inc, int ivisep, int imasac, cs_real_3_t *restrict pvar, const cs_real_3_t *restrict pvara, const int icvfli[], const cs_real_3_t coefav[], const cs_real_33_t coefbv[], const cs_real_3_t cofafv[], const cs_real_33_t cofbfv[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], const cs_real_t i_secvis[], const cs_real_t b_secvis[], cs_real_3_t *restrict rhs)
Add the explicit part of the convection/diffusion terms of a transport equation of a vector field ...
Definition: cs_convection_diffusion.c:4174
double precision, dimension(:,:), pointer diipb
Definition: mesh.f90:212
#define restrict
Definition: cs_defs.h:127
cs_real_t cs_real_2_t[2]
vector of 2 floating-point values
Definition: cs_defs.h:319
cs_real_t cs_real_6_t[6]
vector of 6 floating-point values
Definition: cs_defs.h:322
int cs_field_key_id_try(const char *name)
Return an id associated with a given key name if present.
Definition: cs_field.c:2524
void cs_anisotropic_diffusion_tensor(int idtvar, int f_id, const cs_var_cal_opt_t var_cal_opt, int inc, cs_real_6_t *restrict pvar, const cs_real_6_t *restrict pvara, const cs_real_6_t coefa[], const cs_real_66_t coefb[], const cs_real_6_t cofaf[], const cs_real_66_t cofbf[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *restrict viscel, const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_6_t *restrict rhs)
Add the explicit part of the diffusion terms with a symmetric tensor diffusivity for a transport equa...
Definition: cs_convection_diffusion.c:10184
cs_nvd_type_t
Definition: cs_convection_diffusion.h:59
void cs_face_diffusion_potential(const int f_id, const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int inc, int imrgra, int iccocg, int nswrgp, int imligp, int iphydp, int iwgrp, int iwarnp, double epsrgp, double climgp, cs_real_3_t *restrict frcxt, cs_real_t *restrict pvar, const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t cofafp[], const cs_real_t cofbfp[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_t *restrict visel, cs_real_t *restrict i_massflux, cs_real_t *restrict b_massflux)
Update the face mass flux with the face pressure (or pressure increment, or pressure double increment...
Definition: cs_convection_diffusion.c:10801
void cs_anisotropic_diffusion_scalar(int idtvar, int f_id, const cs_var_cal_opt_t var_cal_opt, int inc, int iccocg, cs_real_t *restrict pvar, const cs_real_t *restrict pvara, const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t cofafp[], const cs_real_t cofbfp[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *restrict viscel, const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_t *restrict rhs)
Add the explicit part of the diffusion terms with a symmetric tensor diffusivity for a transport equa...
Definition: cs_convection_diffusion.c:8168
Field descriptor.
Definition: cs_field.h:125
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources...
Definition: cs_equation_param.h:202
#define CS_ABS(a)
Definition: cs_defs.h:457
cs_field_t * cs_field_by_id(int id)
Return a pointer to a field based on its id.
Definition: cs_field.c:2314
cs_real_t cs_real_66_t[6][6]
6x6 matrix of floating-point values
Definition: cs_defs.h:328
void itrgrp(const int *const f_id, const int *const init, const int *const inc, const int *const imrgra, const int *const iccocg, const int *const nswrgp, const int *const imligp, const int *const iphydp, const int *const iwgrp, const int *const iwarnp, const cs_real_t *const epsrgp, const cs_real_t *const climgp, const cs_real_t *const extrap, cs_real_3_t frcxt[], cs_real_t pvar[], const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t cofafp[], const cs_real_t cofbfp[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_t visel[], cs_real_t diverg[])
Definition: cs_convection_diffusion.c:747
Definition: cs_convection_diffusion.h:68
void cs_slope_test_gradient_tensor(const int inc, const cs_halo_type_t halo_type, const cs_real_63_t *grad, cs_real_63_t *grdpa, const cs_real_6_t *pvar, const cs_real_6_t *coefa, const cs_real_66_t *coefb, const cs_real_t *i_massflux)
Compute the upwind gradient used in the slope tests.
Definition: cs_convection_diffusion.c:1325
double precision pi
value with 16 digits
Definition: cstnum.f90:48
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
void cs_face_convection_scalar(int idtvar, int f_id, const cs_var_cal_opt_t var_cal_opt, int icvflb, int inc, int iccocg, int imasac, cs_real_t *restrict pvar, const cs_real_t *restrict pvara, const int icvfli[], const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], cs_real_2_t i_conv_flux[], cs_real_t b_conv_flux[])
Update face flux with convection contribution of a standard transport equation of a scalar field ...
Definition: cs_convection_diffusion.c:3060
const cs_real_t cs_math_epzero
#define CS_UNUSED(x)
Definition: cs_defs.h:481
void cs_slope_test_gradient_vector(const int inc, const cs_halo_type_t halo_type, const cs_real_33_t *grad, cs_real_33_t *grdpa, const cs_real_3_t *pvar, const cs_real_3_t *coefa, const cs_real_33_t *coefb, const cs_real_t *i_massflux)
Compute the upwind gradient used in the slope tests.
Definition: cs_convection_diffusion.c:1170
double precision, dimension(ncharm), save beta
Definition: cpincl.f90:99
integer(c_int), pointer, save idtvar
option for a variable time step
Definition: optcal.f90:374
void cs_anisotropic_left_diffusion_vector(int idtvar, int f_id, const cs_var_cal_opt_t var_cal_opt, int inc, int ivisep, cs_real_3_t *restrict pvar, const cs_real_3_t *restrict pvara, const cs_real_3_t coefav[], const cs_real_33_t coefbv[], const cs_real_3_t cofafv[], const cs_real_33_t cofbfv[], const cs_real_33_t i_visc[], const cs_real_t b_visc[], const cs_real_t i_secvis[], cs_real_3_t *restrict rhs)
Add explicit part of the terms of diffusion by a left-multiplying symmetric tensorial diffusivity for...
Definition: cs_convection_diffusion.c:8923
Definition: cs_field_pointer.h:67
void cs_math_3_length_unitv(const cs_real_t xa[3], const cs_real_t xb[3], cs_real_t *len, cs_real_3_t unitv)
Compute the length (euclidien norm) between two points xa and xb in a cartesian coordinate system of ...
Definition: cs_math.c:423
Definition: cs_convection_diffusion.h:63
cs_real_t * val
Definition: cs_field.h:146
#define CS_F_(e)
Macro used to return a field pointer by its enumerated value.
Definition: cs_field_pointer.h:51
Definition: cs_convection_diffusion.h:66
integer, dimension(:), allocatable icvfli
boundary convection flux indicator of a Rusanov or an analytical flux (some boundary contributions of...
Definition: cfpoin.f90:52
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
void itrmas(const int *const f_id, const int *const init, const int *const inc, const int *const imrgra, const int *const iccocg, const int *const nswrgp, const int *const imligp, const int *const iphydp, const int *const iwgrp, const int *const iwarnp, const cs_real_t *const epsrgp, const cs_real_t *const climgp, const cs_real_t *const extrap, cs_real_3_t frcxt[], cs_real_t pvar[], const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t cofafp[], const cs_real_t cofbfp[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_t visel[], cs_real_t i_massflux[], cs_real_t b_massflux[])
Definition: cs_convection_diffusion.c:617
int cs_field_get_key_int(const cs_field_t *f, int key_id)
Return a integer value for a given key associated with a field.
Definition: cs_field.c:2991
int cs_field_key_id(const char *name)
Return an id associated with a given key name.
Definition: cs_field.c:2497
cs_equation_param_t * var_cal_opt
Definition: keywords.h:135
void cs_halo_sync_var(const cs_halo_t *halo, cs_halo_type_t sync_mode, cs_real_t var[])
Definition: cs_halo.c:1434
double precision, dimension(ncharm), save b2
Definition: cpincl.f90:233
int iconv
Definition: cs_equation_param.h:453
Definition: cs_convection_diffusion.h:65
cs_lnum_t * group_index
Definition: cs_numbering.h:98
void cs_anisotropic_right_diffusion_vector(int idtvar, int f_id, const cs_var_cal_opt_t var_cal_opt, int inc, cs_real_3_t *restrict pvar, const cs_real_3_t *restrict pvara, const cs_real_3_t coefav[], const cs_real_33_t coefbv[], const cs_real_3_t cofafv[], const cs_real_33_t cofbfv[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *restrict viscel, const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_3_t *restrict rhs)
Add explicit part of the terms of diffusion by a right-multiplying symmetric tensorial diffusivity fo...
Definition: cs_convection_diffusion.c:9471
Definition: cs_field_pointer.h:65
cs_mesh_quantities_t * cs_glob_mesh_quantities
Definition: cs_mesh_quantities.h:89
double blencv
Definition: cs_equation_param.h:472
#define CS_MIN(a, b)
Definition: cs_defs.h:458
cs_halo_type_t
Definition: cs_halo.h:50
void cs_face_anisotropic_diffusion_potential(const int f_id, const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int inc, int imrgra, int iccocg, int nswrgp, int imligp, int ircflp, int iphydp, int iwgrp, int iwarnp, double epsrgp, double climgp, cs_real_3_t *restrict frcxt, cs_real_t *restrict pvar, const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t cofafp[], const cs_real_t cofbfp[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *restrict viscel, const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_t *restrict i_massflux, cs_real_t *restrict b_massflux)
Add the explicit part of the pressure gradient term to the mass flux in case of anisotropic diffusion...
Definition: cs_convection_diffusion.c:11152
Definition: cs_convection_diffusion.h:62
cs_lnum_t cs_lnum_2_t[2]
vector of 2 local mesh-entity ids
Definition: cs_defs.h:313
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:320
int n_groups
Definition: cs_numbering.h:90
int isstpc
Definition: cs_equation_param.h:463
void cs_anisotropic_diffusion_potential(const int f_id, const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int inc, int imrgra, int iccocg, int nswrgp, int imligp, int ircflp, int iphydp, int iwgrp, int iwarnp, double epsrgp, double climgp, cs_real_3_t *restrict frcxt, cs_real_t *restrict pvar, const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t cofafp[], const cs_real_t cofbfp[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *restrict viscel, const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_t *restrict diverg)
Add the explicit part of the divergence of the mass flux due to the pressure gradient (routine analog...
Definition: cs_convection_diffusion.c:12022
Definition: cs_convection_diffusion.h:74
void cs_slope_test_gradient(int f_id, int inc, cs_halo_type_t halo_type, const cs_real_3_t *grad, cs_real_3_t *grdpa, const cs_real_t *pvar, const cs_real_t *coefap, const cs_real_t *coefbp, const cs_real_t *i_massflux)
Compute the upwind gradient used in the slope tests.
Definition: cs_convection_diffusion.c:894
void cs_convection_diffusion_tensor(int idtvar, int f_id, const cs_var_cal_opt_t var_cal_opt, int icvflb, int inc, int imasac, cs_real_6_t *restrict pvar, const cs_real_6_t *restrict pvara, const cs_real_6_t coefa[], const cs_real_66_t coefb[], const cs_real_6_t cofaf[], const cs_real_66_t cofbf[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t *restrict rhs)
Add the explicit part of the convection/diffusion terms of a transport equation of a vector field ...
Definition: cs_convection_diffusion.c:5864
double precision, save fmin
Definition: coincl.f90:133
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:301
cs_lnum_t n_cells_with_ghosts
Definition: cs_mesh.h:150
Definition: cs_convection_diffusion.h:70
#define END_C_DECLS
Definition: cs_defs.h:496
Definition: cs_convection_diffusion.h:67
Definition: cs_convection_diffusion.h:72
cs_numbering_t * b_face_numbering
Definition: cs_mesh.h:162
cs_numbering_t * i_face_numbering
Definition: cs_mesh.h:161
#define CS_PROCF(x, y)
Definition: cs_defs.h:509
#define CS_MAX(a, b)
Definition: cs_defs.h:459
Definition: cs_parameters.h:113
int n_threads
Definition: cs_numbering.h:89
void cs_diffusion_potential(const int f_id, const cs_mesh_t *m, cs_mesh_quantities_t *fvq, int init, int inc, int imrgra, int iccocg, int nswrgp, int imligp, int iphydp, int iwgrp, int iwarnp, double epsrgp, double climgp, cs_real_3_t *restrict frcxt, cs_real_t *restrict pvar, const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t cofafp[], const cs_real_t cofbfp[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_t visel[], cs_real_t *restrict diverg)
Update the cell mass flux divergence with the face pressure (or pressure increment, or pressure double increment) gradient.
Definition: cs_convection_diffusion.c:11639
integer, save kimasf
interior and boundary convective mass flux key ids of the variables
Definition: numvar.f90:187
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:327
Definition: cs_convection_diffusion.h:71
Definition: cs_convection_diffusion.h:61
Definition: cs_convection_diffusion.h:64
void cs_convection_diffusion_scalar(int idtvar, int f_id, const cs_var_cal_opt_t var_cal_opt, int icvflb, int inc, int iccocg, int imasac, cs_real_t *restrict pvar, const cs_real_t *restrict pvara, const int icvfli[], const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t cofafp[], const cs_real_t cofbfp[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_t *restrict rhs)
Add the explicit part of the convection/diffusion terms of a standard transport equation of a scalar ...
Definition: cs_convection_diffusion.c:1622
cs_real_t cs_real_63_t[6][3]
Definition: cs_defs.h:335
cs_real_t * cell_vol
Definition: cs_mesh_quantities.h:92
integer, save kbmasf
Definition: numvar.f90:187
cs_lnum_2_t * i_face_cells
Definition: cs_mesh.h:110
void cs_halo_sync_component(const cs_halo_t *halo, cs_halo_type_t sync_mode, cs_halo_rotation_t rotation_op, cs_real_t var[])
Definition: cs_halo.c:1754
void itrmav(const int *const f_id, const int *const init, const int *const inc, const int *const imrgra, const int *const iccocg, const int *const nswrgp, const int *const imligp, const int *const ircflp, const int *const iphydp, const int *const iwgrp, const int *const iwarnp, const cs_real_t *const epsrgp, const cs_real_t *const climgp, const cs_real_t *const extrap, cs_real_3_t frcxt[], cs_real_t pvar[], const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t cofafp[], const cs_real_t cofbfp[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_6_t viscel[], const cs_real_2_t weighf[], const cs_real_t weighb[], cs_real_t i_massflux[], cs_real_t b_massflux[])
Definition: cs_convection_diffusion.c:679
void cs_beta_limiter_building(int f_id, int inc, const cs_real_t rovsdt[])
Compute the beta blending coefficient of the beta limiter (ensuring preservation of a given min/max p...
Definition: cs_convection_diffusion.c:1471
void cs_convection_diffusion_thermal(int idtvar, int f_id, const cs_var_cal_opt_t var_cal_opt, int inc, int iccocg, int imasac, cs_real_t *restrict pvar, const cs_real_t *restrict pvara, const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t cofafp[], const cs_real_t cofbfp[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], const cs_real_t xcpp[], cs_real_t *restrict rhs)
Add the explicit part of the convection/diffusion terms of a transport equation of a scalar field su...
Definition: cs_convection_diffusion.c:6830
double precision, dimension(ncharm), save b1
Definition: cpincl.f90:233
void cs_upwind_gradient(const int f_id, const int inc, const cs_halo_type_t halo_type, const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t *restrict pvar, cs_real_3_t *restrict grdpa)
Compute the upwind gradient in order to cope with SOLU schemes observed in the litterature.
Definition: cs_convection_diffusion.c:1038
Definition: cs_convection_diffusion.h:69
integer(c_int), pointer, save imrgra
type of gradient reconstruction
Definition: optcal.f90:251
cs_halo_t * halo
Definition: cs_mesh.h:155
cs_lnum_t * b_face_cells
Definition: cs_mesh.h:111
Definition: cs_convection_diffusion.h:73