9.1
general documentation
cs_boundary_conditions_set_coeffs.h
Go to the documentation of this file.
1#ifndef __CS_BOUNDARY_CONDITIONS_SET_COEFFS_H__
2#define __CS_BOUNDARY_CONDITIONS_SET_COEFFS_H__
3
4/*============================================================================
5 * Translation of the boundary conditions given by the user in a form
6 * that fits the solver.
7 *============================================================================*/
8
9/*
10 This file is part of code_saturne, a general-purpose CFD tool.
11
12 Copyright (C) 1998-2025 EDF S.A.
13
14 This program is free software; you can redistribute it and/or modify it under
15 the terms of the GNU General Public License as published by the Free Software
16 Foundation; either version 2 of the License, or (at your option) any later
17 version.
18
19 This program is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
22 details.
23
24 You should have received a copy of the GNU General Public License along with
25 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
26 Street, Fifth Floor, Boston, MA 02110-1301, USA.
27*/
28
29/*----------------------------------------------------------------------------*/
30
31/*----------------------------------------------------------------------------
32 * Local headers
33 *----------------------------------------------------------------------------*/
34
35#include "base/cs_defs.h"
36
37#include "base/cs_profiling.h"
38#include "bft/bft_error.h"
39#include "base/cs_field.h"
40#include "base/cs_math.h"
41#include "base/cs_profiling.h"
43
44#ifdef __cplusplus
45#include "base/cs_dispatch.h"
46#endif
47
48/*----------------------------------------------------------------------------*/
49
51
52/*=============================================================================
53 * Public function prototypes
54 *============================================================================*/
55
56/*----------------------------------------------------------------------------*/
57/*
58 * \brief Translation of the boundary conditions given by the user
59 * in a form that fits to the solver.
60 *
61 * The values at a boundary face \f$ \fib \f$ stored in the face center
62 * \f$ \centf \f$ of the variable \f$ P \f$ and its diffusive flux \f$ Q \f$
63 * are written as:
64 * \f[
65 * P_{\face} = A_P^g + B_P^g P_{\centi}
66 * \f]
67 * and
68 * \f[
69 * Q_{\face} = A_P^f + B_P^f P_{\centi}
70 * \f]
71 * where \f$ P_\centi \f$ is the value of the variable \f$ P \f$ at the
72 * neighboring cell.
73 *
74 * \warning
75 * - If we consider an increment of a variable, the boundary conditions
76 * read:
77 * \f[
78 * \delta P_{\face} = B_P^g \delta P_{\centi}
79 * \f]
80 * and
81 * \f[
82 * \delta Q_{\face} = -B_P^f \delta P_{\centi}
83 * \f]
84 *
85 * - For a vector field such as the velocity \f$ \vect{u} \f$ the boundary
86 * conditions may read:
87 * \f[
88 * \vect{u}_{\face} = \vect{A}_u^g + \tens{B}_u^g \vect{u}_{\centi}
89 * \f]
90 * and
91 * \f[
92 * \vect{Q}_{\face} = \vect{A}_u^f + \tens{B}_u^f \vect{u}_{\centi}
93 * \f]
94 * where \f$ \tens{B}_u^g \f$ and \f$ \tens{B}_u^f \f$ are 3x3 tensor matrix
95 * which coupled velocity components next to a boundary.
96 *
97 * Please refer to the
98 * <a href="../../theory.pdf#boundary"><b>boundary conditions</b></a> section
99 * of the theory guide for more informations, as well as the
100 * <a href="../../theory.pdf#condli"><b>condli</b></a> section.
101 *
102 * \param[in] nvar total number of variables
103 * \param[in] iterns iteration number on Navier-Stokes equations
104 * \param[in] isvhb id of field whose exchange coeffient should be
105 * saved at the walls, or -1.
106 * \param[in] italim for ALE
107 * \param[in] itrfin Last velocity-pressure sub-iteration indicator
108 * \param[in] ineefl for ALE
109 * \param[in] itrfup Update after velocity-pressure sub-iterations
110 * \param[in, out] isostd indicator for standard outlet
111 * and reference face index
112 * \param[in] dt time step (per cell)
113 * \param[in, out] visvdr dynamic viscosity after V. Driest damping in
114 * boundary cells
115 * \param[out] hbord exchange coefficient at boundary
116 * \param[out] theipb value of thermal scalar at \f$ \centip \f$
117 * f boundary cells
118 * \param[in] nftcdt Global indicator of condensation source terms
119 * (ie. sum on the processors of nfbpcd) cells
120 * associated to the face with condensation
121 * phenomenon
122 */
123/*----------------------------------------------------------------------------*/
124
125void
127 int iterns,
128 int isvhb,
129 int italim,
130 int itrfin,
131 int ineefl,
132 int itrfup,
133 int isostd[],
134 cs_real_t *visvdr,
135 cs_real_t hbord[],
136 cs_real_t theipb[],
137 int nftcdt);
138
139/*----------------------------------------------------------------------------*/
143/*----------------------------------------------------------------------------*/
144
145void
147
148/*----------------------------------------------------------------------------*/
159/*----------------------------------------------------------------------------*/
160
161CS_F_HOST_DEVICE inline static void
163 cs_real_t af[3],
164 cs_real_t b[3][3],
165 cs_real_t bf[3][3],
166 const cs_real_t qimpv[3],
167 cs_real_t hint)
168{
169 /* Gradient BCs */
170
171 for (size_t i = 0; i < 3; i++) {
172 a[i] = -qimpv[i] / fmax(hint, 1.e-300);
173 }
174
175 b[0][0] = 1., b[0][1] = 0., b[0][2] = 0.;
176 b[1][0] = 0., b[1][1] = 1., b[1][2] = 0.;
177 b[2][0] = 0., b[2][1] = 0., b[2][2] = 1.;
178
179 /* Flux BCs */
180
181 for (size_t i = 0; i < 3; i++) {
182 af[i] = qimpv[i];
183
184 for (size_t j = 0; j < 3; j++)
185 bf[i][j] = 0.;
186 }
187}
188
189/*----------------------------------------------------------------------------*/
200/*----------------------------------------------------------------------------*/
201
202CS_F_HOST_DEVICE inline static void
204 cs_real_t af[3],
205 cs_real_t b[3][3],
206 cs_real_t bf[3][3],
207 const cs_real_t qimpv[3],
208 const cs_real_t hint[6])
209{
210 cs_real_t m[6] = {0., 0., 0., 0., 0., 0.};
211 m[0] = hint[1]*hint[2] - hint[4]*hint[4];
212 m[1] = hint[0]*hint[2] - hint[5]*hint[5];
213 m[2] = hint[0]*hint[1] - hint[3]*hint[3];
214 m[3] = hint[4]*hint[5] - hint[3]*hint[2];
215 m[4] = hint[3]*hint[5] - hint[0]*hint[4];
216 m[5] = hint[3]*hint[4] - hint[1]*hint[5];
217
218 cs_real_t invdet = 1./(hint[0]*m[0] + hint[3]*m[3] + hint[5]*m[5]);
219
220 cs_real_t invh[6] = {0., 0., 0., 0., 0., 0.};
221 invh[0] = m[0] * invdet;
222 invh[1] = m[1] * invdet;
223 invh[2] = m[2] * invdet;
224 invh[3] = m[3] * invdet;
225 invh[4] = m[4] * invdet;
226 invh[5] = m[5] * invdet;
227
228 /* Gradient BCs */
229 cs_math_sym_33_3_product(invh, qimpv, a);
230 for (cs_lnum_t i = 0; i < 3; i++)
231 a[i] = -a[i];
232
233 b[0][0] = 1.0, b[0][1] = 0.0, b[0][2] = 0.0;
234 b[1][0] = 0.0, b[1][1] = 1.0, b[1][2] = 0.0;
235 b[2][0] = 0.0, b[2][1] = 0.0, b[2][2] = 1.0;
236
237 for (cs_lnum_t i = 0; i < 3; i++) {
238 /* Flux BCs */
239 af[i] = qimpv[i];
240 for (cs_lnum_t jsou = 0; jsou < 3; jsou++)
241 bf[i][jsou] = 0.0;
242 }
243}
244
245/*----------------------------------------------------------------------------*/
255/*----------------------------------------------------------------------------*/
256
257CS_F_HOST_DEVICE inline static void
259 cs_real_t af[6],
260 cs_real_t b[6][6],
261 cs_real_t bf[6][6],
262 const cs_real_t qimpts[6],
263 cs_real_t hint)
264{
265 for (int i = 0; i < 6; i++) {
266
267 /* Gradient BC */
268 a[i] = -qimpts[i]/cs::max(hint, 1.e-300);
269 for (int jsou = 0; jsou < 6; jsou++) {
270 if (jsou == i)
271 b[i][jsou] = 1.0;
272 else
273 b[i][jsou] = 0.0;
274 }
275
276 /* Flux BCs */
277 af[i] = qimpts[i];
278 for (int jsou = 0; jsou < 6; jsou++)
279 bf[i][jsou] = 0.0;
280 }
281}
282
283/*----------------------------------------------------------------------------*/
296/*----------------------------------------------------------------------------*/
297
298CS_F_HOST_DEVICE inline static void
300 cs_real_t af[3],
301 cs_real_t b[3][3],
302 cs_real_t bf[3][3],
303 const cs_real_t pimpv[3],
304 cs_real_t hint,
305 const cs_real_t hextv[3])
306{
307 for (int i = 0; i < 3; i++) {
308 if (fabs(hextv[i]) > 0.5*cs_math_infinite_r) {
309
310 /* Gradient BCs */
311 a[i] = pimpv[i];
312 for (int jsou = 0; jsou < 3; jsou++)
313 b[i][jsou] = 0.;
314
315 /* Flux BCs */
316 af[i] = -hint*pimpv[i];
317
318 bf[0][0] = hint, bf[0][1] = 0., bf[0][2] = 0.;
319 bf[1][0] = 0., bf[1][1] = hint, bf[1][2] = 0.;
320 bf[2][0] = 0., bf[2][1] = 0., bf[2][2] = hint;
321
322 }
323 else {
324
325 const cs_real_t val = hint/(hint + hextv[i]);
326 const cs_real_t heq = hextv[i]*val;
327
328 /* Gradient BCs */
329 a[i] = hextv[i]*pimpv[i]/(hint + hextv[i]);
330
331 b[0][0] = val, b[0][1] = 0., b[0][2] = 0.;
332 b[1][0] = 0., b[1][1] = val, b[1][2] = 0.;
333 b[2][0] = 0., b[2][1] = 0., b[2][2] = val;
334
335 /* Flux BCs */
336 af[i] = -heq*pimpv[i];
337
338 bf[0][0] = heq, bf[0][1] = 0., bf[0][2] = 0.;
339 bf[1][0] = 0., bf[1][1] = heq, bf[1][2] = 0.;
340 bf[2][0] = 0., bf[2][1] = 0., bf[2][2] = heq;
341
342 }
343 }
344}
345
346/*----------------------------------------------------------------------------*/
347/*
348 * \brief Set convective oulet BC for a scalar for a given face.
349 *
350 * \param[out] a explicit BC coefficient for gradients
351 * \param[out] af explicit BC coefficient for diffusive flux
352 * \param[out] b implicit BC coefficient for gradients
353 * \param[out] bf implicit BC coefficient for diffusive flux
354 * \param[in] pimp flux value to impose
355 * \param[in] cfl local Courant number used to convect
356 * \param[in] hint internal exchange coefficient
357 */
358/*----------------------------------------------------------------------------*/
359
362 (cs_real_t &a,
363 cs_real_t &af,
364 cs_real_t &b,
365 cs_real_t &bf,
366 cs_real_t pimp,
367 cs_real_t cfl,
368 cs_real_t hint);
369
370/*----------------------------------------------------------------------------*/
384/*----------------------------------------------------------------------------*/
385
386CS_F_HOST_DEVICE inline static void
388 (cs_real_t a[3],
389 cs_real_t af[3],
390 cs_real_t b[3][3],
391 cs_real_t bf[3][3],
392 const cs_real_t pimpv[3],
393 const cs_real_t hintt[6],
394 const cs_real_t hextv[3])
395{
396 /* Gradient BCs */
397 for (int i = 0; i < 3; i++) {
398 if (fabs(hextv[i]) > 0.5*cs_math_infinite_r) {
399 a[i] = pimpv[i];
400 for (int jsou = 0; jsou < 3; jsou++)
401 b[i][jsou] = 0.;
402 }
403 else {
404 /* FIXME: at least log error message */
405#if defined(CS_DEVICE_COMPILE)
406 assert(0);
407#else
408 bft_error(__FILE__, __LINE__, 0,
409 _(" %s: hextv not set for component %d."),
410 __func__, i);
411#endif
412 }
413 }
414
415 /* Flux BCs */
416 cs_math_sym_33_3_product(hintt, pimpv, af);
417 for (int i = 0; i < 3; i++)
418 af[i] = -af[i];
419
420 bf[0][0] = hintt[0];
421 bf[1][1] = hintt[1];
422 bf[2][2] = hintt[2];
423 bf[0][1] = hintt[3];
424 bf[1][0] = hintt[3];
425 bf[1][2] = hintt[4];
426 bf[2][1] = hintt[4];
427 bf[0][2] = hintt[5];
428 bf[2][0] = hintt[5];
429}
430
431/*----------------------------------------------------------------------------*/
443/*----------------------------------------------------------------------------*/
444
445CS_F_HOST_DEVICE inline static void
447 cs_real_t af[6],
448 cs_real_t b[6][6],
449 cs_real_t bf[6][6],
450 const cs_real_t pimpts[6],
451 cs_real_t hint,
452 const cs_real_t hextts[6])
453{
454 for (int i = 0; i < 6; i++) {
455
456 if (fabs(hextts[i]) > 0.5*cs_math_infinite_r) {
457 /* Gradient BCs */
458 a[i] = pimpts[i];
459 for (int jsou = 0; jsou < 6; jsou++)
460 b[i][jsou] = 0.;
461
462 /* Flux BCs */
463 af[i] = -hint * pimpts[i];
464 for (int jsou = 0; jsou < 6; jsou++) {
465 if (jsou == i)
466 bf[i][jsou] = hint;
467 else
468 bf[i][jsou] = 0.;
469 }
470 }
471
472 else {
473
474 const cs_real_t heq = hint * hextts[i] / (hint + hextts[i]);
475
476 /* Gradient BCs */
477 a[i] = hextts[i] * pimpts[i] / (hint + hextts[i]);
478 for (int jsou = 0; jsou < 6; jsou++) {
479 if (jsou == i)
480 b[i][jsou] = hint / (hint + hextts[i]);
481 else
482 b[i][jsou] = 0.;
483 }
484
485 /* Flux BCs */
486 af[i] = -heq * pimpts[i];
487 for (int jsou = 0; jsou < 6; jsou++) {
488 if (jsou == i)
489 bf[i][jsou] = heq;
490 else
491 bf[i][jsou] = 0.;
492 }
493 }
494 }
495}
496
497/*----------------------------------------------------------------------------*/
510/*----------------------------------------------------------------------------*/
511
512CS_F_HOST_DEVICE inline static void
514 (cs_real_t a[3],
515 cs_real_t af[3],
516 cs_real_t b[3][3],
517 cs_real_t bf[3][3],
518 const cs_real_t pimpv[3],
519 const cs_real_t qimpv[3],
520 cs_real_t hint,
521 const cs_nreal_t normal[3])
522{
523 for (int i = 0; i < 3; i++) {
524
525 /* Gradient BCs */
526 a[i] = - qimpv[i]/cs::max(hint, 1.e-300);
527 /* "[1 -n(x)n] Qimp / hint" is divided into two */
528 for (int j = 0; j < 3; j++) {
529
530 a[i] = a[i] + normal[i]*normal[j]
531 * (pimpv[j] + qimpv[j] / cs::max(hint, 1.e-300));
532
533 if (j == i)
534 b[i][j] = 1.0 - normal[i] * normal[j];
535 else
536 b[i][j] = - normal[i] * normal[j];
537 }
538
539 /* Flux BCs */
540 af[i] = qimpv[i];
541 /* "[1 -n(x)n] Qimp" is divided into two */
542 for (int j = 0; j < 3; j++){
543
544 af[i] = af[i] - normal[i]*normal[j]
545 * (hint * pimpv[j] + qimpv[j]);
546
547 bf[i][j] = hint * normal[i] * normal[j];
548 }
549 }
550}
551
552/*----------------------------------------------------------------------------*/
566/*----------------------------------------------------------------------------*/
567
570 (cs_real_t a[3],
571 cs_real_t af[3],
572 cs_real_t b[3][3],
573 cs_real_t bf[3][3],
574 const cs_real_t pimpv[3],
575 const cs_real_t qimpv[3],
576 const cs_real_t hint[6],
577 const cs_nreal_t normal[3]);
578
579/*----------------------------------------------------------------------------*/
593/*----------------------------------------------------------------------------*/
594
595CS_F_HOST_DEVICE inline static void
597 (cs_real_t a[3],
598 cs_real_t af[3],
599 cs_real_t b[3][3],
600 cs_real_t bf[3][3],
601 const cs_real_t pimpv[3],
602 const cs_real_t qimpv[3],
603 cs_real_t hint,
604 const cs_nreal_t normal[3])
605{
606 for (int i = 0; i < 3; i++) {
607
608 /* Gradient BC*/
609 /* "[1 -n(x)n] Pimp" is divided into two */
610 a[i] = pimpv[i];
611 for (int j = 0; j < 3; j++) {
612
613 a[i] = a[i] - normal[i]*normal[j]
614 * (pimpv[j] + qimpv[j] / cs::max(hint, 1.e-300));
615
616 b[i][j] = normal[i] * normal[j];
617 }
618
619 /* Flux BC */
620 /* "[1 -n(x)n] Pimp" is divided into two */
621 af[i] = -hint*pimpv[i];
622 for (int j = 0; j < 3; j++) {
623
624 af[i] = af[i] + normal[i]*normal[j]
625 * (qimpv[j] + pimpv[j] * hint);
626
627 if (j == i)
628 bf[i][j] = hint * (1.0 - normal[i] * normal[j]);
629 else
630 bf[i][j] = - hint * normal[i] * normal[j];
631 }
632 }
633}
634
635/*----------------------------------------------------------------------------*/
651/*----------------------------------------------------------------------------*/
652
653CS_F_HOST_DEVICE inline static void
655 (cs_real_t a[6],
656 cs_real_t af[6],
657 cs_real_t b[6][6],
658 cs_real_t bf[6][6],
659 const cs_real_t pimpv[6],
660 const cs_real_t qimpv[6],
661 cs_real_t hint,
662 const cs_nreal_t normal[3])
663{
664 const int iv2t[6] = {0, 1, 2, 0, 1, 0};
665 const int jv2t[6] = {0, 1, 2, 1, 2, 2};
666 const cs_real_t delta[3][3] = {{1., 0., 0.}, {0., 1., 0.}, {0., 0., 1.}};
667
668 cs_real_t d[6][6];
669 cs_real_t n[6][6];
670
671 for (int ij = 0; ij < 6; ij++) {
672
673 int i = iv2t[ij];
674 int j = jv2t[ij];
675 /* Gradient BC*/
676 /* "[1 -n(x)n] Pimp" is divided into two */
677 //a[ij] = pimpv[ij];
678 a[ij] = 0;
679 for (int kl = 0; kl < 6; kl++) {
680
681 int k = iv2t[kl];
682 int l = jv2t[kl];
683
684 d[ij][kl] = (delta[i][k] - normal[i]*normal[k]) * normal[l]*normal[j]
685 + normal[i]*normal[k] * (delta[j][l] - normal[l]*normal[j]);
686
687 n[ij][kl] = normal[i]*normal[k]*normal[l]*normal[j]
688 + (delta[i][k] - normal[i]*normal[k])
689 * (delta[j][l] - normal[j]*normal[l]);
690
691 a[ij] += d[ij][kl]*pimpv[kl]
692 - n[ij][kl]*qimpv[kl]/(cs::max(hint, 1.e-300));
693
694 b[ij][kl] = n[ij][kl];
695 }
696
697 /* Flux BC */
698 /* "[1 -n(x)n] Pimp" is divided into two */
699 //af[ij] = -hint*pimpv[ij];
700 af[ij] = 0;
701 for (int kl = 0; kl < 6; kl++) {
702
703 int k = iv2t[kl];
704 int l = jv2t[kl];
705
706 d[ij][kl] = (delta[i][k] - normal[i]*normal[k]) * normal[l]*normal[j]
707 + normal[i]*normal[k] * (delta[j][l] - normal[l]*normal[j]);
708
709 n[ij][kl] = normal[i]*normal[k]*normal[l]*normal[j]
710 + (delta[i][k] - normal[i]*normal[k])
711 * (delta[j][l] - normal[l]*normal[j]);
712
713 af[ij] += n[ij][kl]*qimpv[kl]
714 - hint*d[ij][kl]*pimpv[kl];
715
716 bf[ij][kl] = hint*d[ij][kl];
717 }
718 }
719}
720
721/*----------------------------------------------------------------------------*/
736/*----------------------------------------------------------------------------*/
737
740 (cs_real_t a[3],
741 cs_real_t af[3],
742 cs_real_t b[3][3],
743 cs_real_t bf[3][3],
744 const cs_real_t pimpv[3],
745 const cs_real_t qimpv[3],
746 const cs_real_t hint[6],
747 const cs_nreal_t normal[3]);
748
749/*----------------------------------------------------------------------------*/
761/*----------------------------------------------------------------------------*/
762
763CS_F_HOST_DEVICE inline static void
765 (cs_real_t a[3],
766 cs_real_t af[3],
767 cs_real_t b[3][3],
768 cs_real_t bf[3][3],
769 const cs_real_t pimpv[3],
770 const cs_real_t cflv[3],
771 cs_real_t hint)
772{
773 for (int i = 0; i < 3; i++) {
774
775 /* Gradient BCs */
776 for (int j = 0; j < 3; j ++) {
777 if (j == i)
778 b[i][j] = cflv[i] / (1.0 + cflv[i]);
779 else
780 b[i][j] = 0.0;
781 }
782 a[i] = pimpv[i] * (1.0 - b[i][i]);
783
784 /* Flux BCs */
785 af[i] = -hint * a[i];
786 for (int j = 0; j < 3; j++) {
787 if (j == i)
788 bf[i][j] = hint * (1.0 - b[i][j]);
789 else
790 bf[i][j] = 0.0;
791 }
792 }
793}
794
795/*----------------------------------------------------------------------------*/
807/*----------------------------------------------------------------------------*/
808
809CS_F_HOST_DEVICE inline static void
811 cs_real_t af[6],
812 cs_real_t b[6][6],
813 cs_real_t bf[6][6],
814 const cs_real_t pimpts[6],
815 const cs_real_t cflts[6],
816 cs_real_t hint)
817{
818 for (int ij = 0; ij < 6; ij++) {
819
820 /* Gradient BCs */
821 for (int kl = 0; kl < 6; kl++) {
822 if (kl == ij)
823 b[ij][kl] = cflts[ij] / (1.0 + cflts[ij]);
824 else
825 b[ij][kl] = 0.0;
826 }
827 a[ij] = (1.0 - b[ij][ij]) * pimpts[ij];
828
829 /* Flux BCs */
830 af[ij] = -hint*a[ij];
831 for (int kl = 0; kl < 6; kl++) {
832 if (kl == ij)
833 bf[ij][kl] = hint * (1.0 - b[ij][kl]);
834 else
835 bf[ij][kl] = 0.0;
836 }
837 }
838}
839
840/*----------------------------------------------------------------------------*/
852/*----------------------------------------------------------------------------*/
853
854CS_F_HOST_DEVICE inline static void
856 (cs_real_t a[3],
857 cs_real_t af[3],
858 cs_real_t b[3][3],
859 cs_real_t bf[3][3],
860 const cs_real_t pimpv[3],
861 const cs_real_t cflv[3],
862 const cs_real_t hintt[6])
863{
864 for(int i = 0; i < 3; i++) {
865
866 /* Gradient BCs */
867 for (int j = 0; j < 3; j++) {
868 if (j == i)
869 b[i][j] = cflv[i]/(1.0+cflv[i]);
870 else
871 b[i][j] = 0.0;
872 }
873 a[i] = (1.0-b[i][i])*pimpv[i];
874
875 }
876
877 /* Flux BCs */
878 cs_math_sym_33_3_product(hintt, a, af);
879 for (int i = 0; i < 3; i++)
880 af[i] = -af[i];
881
882 bf[0][0] = hintt[0]*(1.0 - b[0][0]);
883 bf[1][1] = hintt[1]*(1.0 - b[1][1]);
884 bf[2][2] = hintt[2]*(1.0 - b[2][2]);
885 bf[0][1] = hintt[3]*(1.0 - b[0][0]);
886 bf[1][0] = hintt[3]*(1.0 - b[0][0]);
887 bf[1][2] = hintt[4]*(1.0 - b[1][1]);
888 bf[2][1] = hintt[4]*(1.0 - b[1][1]);
889 bf[0][2] = hintt[5]*(1.0 - b[2][2]);
890 bf[2][0] = hintt[5]*(1.0 - b[2][2]);
891}
892
893/*----------------------------------------------------------------------------*/
905/*----------------------------------------------------------------------------*/
906
907CS_F_HOST_DEVICE inline static void
909 (cs_real_t a[3],
910 cs_real_t af[3],
911 cs_real_t b[3][3],
912 cs_real_t bf[3][3],
913 const cs_real_t pimpv[3],
914 const cs_real_t qimpv[3])
915{
916 for (int i = 0; i < 3; i++) {
917
918 /* Gradient BCs */
919 a[i] = pimpv[i];
920 for (int j = 0; j < 3; j++)
921 b[i][j] = 0.0;
922
923 /* Flux BCs */
924 af[i] = qimpv[i];
925 for (int j = 0; j < 3; j++)
926 bf[i][j] = 0.0;
927 }
928}
929
930/*----------------------------------------------------------------------------*/
942/*----------------------------------------------------------------------------*/
943
944CS_F_HOST_DEVICE inline static void
946 (cs_real_t a[6],
947 cs_real_t af[6],
948 cs_real_t b[6][6],
949 cs_real_t bf[6][6],
950 const cs_real_t pimpts[6],
951 const cs_real_t qimpts[6])
952{
953 for (int ij = 0; ij < 6; ij++) {
954
955 /* BS test on hextv ? if (abs(hextv[ij]) > cs_math_infinite_r * 0.5) */
956
957 /* Gradient BCs */
958 a[ij] = pimpts[ij];
959 for (int kl = 0; kl < 6; kl++)
960 b[ij][kl] = 0.0;
961
962 /* Flux BCs */
963 af[ij] = qimpts[ij];
964 for (int kl = 0; kl < 6; kl++)
965 bf[ij][kl] = 0.0;
966 }
967}
968
969/*----------------------------------------------------------------------------*/
970
972
973#ifdef __cplusplus
974
975/*============================================================================
976 * Public C++ function definitions
977 *============================================================================*/
978
979/*----------------------------------------------------------------------------*/
990/*----------------------------------------------------------------------------*/
991
992CS_F_HOST_DEVICE inline static void
994 cs_real_t &af,
995 cs_real_t &b,
996 cs_real_t &bf,
997 cs_real_t qimp,
998 cs_real_t hint)
999{
1000 /* Gradient BCs */
1001 a = -qimp/cs::max(hint, 1.e-300);
1002 b = 1.;
1003
1004 /* Flux BCs */
1005 af = qimp;
1006 bf = 0.;
1007}
1008
1009/*----------------------------------------------------------------------------*/
1018/*----------------------------------------------------------------------------*/
1019
1020CS_F_HOST_DEVICE inline static void
1022 cs_real_t &af,
1023 cs_real_t &b,
1024 cs_real_t &bf)
1025{
1026 /* Gradient BCs */
1027 a = 0.;
1028 b = 1.;
1029
1030 /* Flux BCs */
1031 af = 0.;
1032 bf = 0.;
1033}
1034
1035/*----------------------------------------------------------------------------*/
1048/*----------------------------------------------------------------------------*/
1049
1050CS_F_HOST_DEVICE inline static void
1052 cs_real_t &af,
1053 cs_real_t &b,
1054 cs_real_t &bf,
1055 cs_real_t pimp,
1056 cs_real_t hint,
1057 cs_real_t hext)
1058{
1059 if (hext < 0.) {
1060
1061 /* Gradient BCs */
1062 a = pimp;
1063 b = 0.;
1064
1065 /* Flux BCs */
1066 af = -hint*pimp;
1067 bf = hint;
1068
1069 }
1070 else {
1071
1072 /* Gradient BCs */
1073 a = hext*pimp/(hint + hext);
1074 b = hint /(hint + hext);
1075
1076 /* Flux BCs */
1077 cs_real_t heq = hint*hext/(hint + hext);
1078 af = -heq*pimp;
1079 bf = heq;
1080
1081 }
1082}
1083
1084/*----------------------------------------------------------------------------*/
1095/*----------------------------------------------------------------------------*/
1096
1097CS_F_HOST_DEVICE inline static void
1099 (cs_real_t &a,
1100 cs_real_t &af,
1101 cs_real_t &b,
1102 cs_real_t &bf,
1103 cs_real_t dimp,
1104 cs_real_t hint)
1105
1106{
1107 /* Gradient BCs */
1109 af,
1110 b,
1111 bf,
1112 dimp,
1113 hint);
1114
1115 /* Flux BCs */
1116 af = 0.;
1117 bf = 0.;
1118}
1119
1120/*----------------------------------------------------------------------------*/
1132/*----------------------------------------------------------------------------*/
1133
1134CS_F_HOST_DEVICE inline static void
1136 (cs_real_t &a,
1137 cs_real_t &af,
1138 cs_real_t &b,
1139 cs_real_t &bf,
1140 cs_real_t pinf,
1141 cs_real_t ratio,
1142 cs_real_t hint)
1143{
1144 /* Gradient BCs */
1145 b = ratio;
1146 a = pinf;
1147
1148 /* Flux BCs */
1149 af = -hint * a;
1150 bf = hint * (1. - b);
1151}
1152
1153/*----------------------------------------------------------------------------*/
1166/*----------------------------------------------------------------------------*/
1167
1168CS_F_HOST_DEVICE inline static void
1170 (cs_real_t &a,
1171 cs_real_t &af,
1172 cs_real_t &b,
1173 cs_real_t &bf,
1174 cs_real_t pinf,
1175 cs_real_t ratio,
1176 cs_real_t dimp)
1177{
1178 /* Gradient BCs */
1179 b = ratio;
1180 a = pinf;
1181
1182 /* Flux BCs */
1183 af = dimp;
1184 bf = 0.;
1185}
1186
1187/*----------------------------------------------------------------------------*/
1198/*----------------------------------------------------------------------------*/
1199
1200CS_F_HOST_DEVICE inline static void
1202 cs_real_t &af,
1203 cs_real_t &b,
1204 cs_real_t &bf,
1205 cs_real_t hext,
1206 cs_real_t dimp)
1207{
1208 /* Gradients BCs */
1209 a = 0.;
1210 b = 1.;
1211
1212 /* Flux BCs */
1213 af = dimp;
1214 bf = hext;
1215}
1216
1217/*----------------------------------------------------------------------------*/
1229/*----------------------------------------------------------------------------*/
1230
1231CS_F_HOST_DEVICE inline static void
1233 (cs_real_t &a,
1234 cs_real_t &af,
1235 cs_real_t &b,
1236 cs_real_t &bf,
1237 cs_real_t pimp,
1238 cs_real_t dimp)
1239{
1240 /* Gradients BC */
1241 a = pimp;
1242 b = 0.;
1243
1244 /* Flux BCs */
1245 af = dimp;
1246 bf = 0.;
1247}
1248
1249/*----------------------------------------------------------------------------*/
1250/*
1251 * \brief Update face value for gradient and diffusion when solving
1252 * in increment.
1253 *
1254 * \param[in] ctx reference to dispatch context
1255 * \param[in] f pointer to field
1256 * \param[in] bc_coeffs boundary condition structure
1257 * \param[in] inc 0 if an increment, 1 otherwise
1258 * \param[in] eqp equation parameters
1259 * \param[in] need_compute_bc_grad val_f must be computed
1260 * \param[in] need_compute_bc_flux flux must be computed
1261 * \param[in] hyd_p_flag hydrostatic pressure indicator
1262 * \param[in] f_ext exterior force generating pressure
1263 * \param[in] visel viscosity by cell, or nullptr
1264 * \param[in] viscel symmetric cell tensor
1265 \f$ \tens{\mu}_\celli \f$,
1266 or nullptr
1267 * \param[in] weighb boundary face weight for cells i in
1268 * case of tensor diffusion, or nullptr
1269 * \param[in] var variable values at cell centers
1270 * \param[in,out] var_f face values for the gradient computation
1271 * \param[in,out] flux face values for the diffusion computation
1272 *
1273 */
1274/*----------------------------------------------------------------------------*/
1275
1276void
1278 (cs_dispatch_context &ctx,
1279 const cs_field_t *f,
1280 const cs_field_bc_coeffs_t *bc_coeffs,
1281 const int inc,
1282 const cs_equation_param_t *eqp,
1283 const bool need_compute_bc_grad,
1284 const bool need_compute_bc_flux,
1285 int hyd_p_flag,
1286 cs_real_t f_ext[][3],
1287 cs_real_t visel[],
1288 cs_real_t viscel[][6],
1289 const cs_real_t weighb[],
1290 const cs_real_t pvar[],
1291 cs_real_t val_f[],
1292 cs_real_t flux[]);
1293
1294/*----------------------------------------------------------------------------*/
1295/*
1296 * \brief Update boundary coefficient face values for gradient and diffusion
1297 * when solving for a given field.
1298 *
1299 * \param[in] ctx reference to dispatch context
1300 * \param[in, out] f pointer to field
1301 * \param[in] eqp equation parameters
1302 * \param[in] need_compute_bc_grad val_f must be computed
1303 * \param[in] need_compute_bc_flux flux must be computed
1304 * \param[in] hyd_p_flag flag for hydrostatic pressure
1305 * \param[in] f_ext exterior force generating pressure
1306 * \param[in] viscel symmetric cell tensor
1307 \f$ \tens{\mu}_\celli \f$,
1308 or nullptr
1309 * \param[in] weighb boundary face weight for cells i in
1310 * case of tensor diffusion, or nullptr
1311 * \param[in] pvar variable values at cell centers
1312 */
1313/*----------------------------------------------------------------------------*/
1314
1315void
1317 (cs_dispatch_context &ctx,
1318 cs_field_t *f,
1319 const cs_equation_param_t *eqp,
1320 const bool need_compute_bc_grad,
1321 const bool need_compute_bc_flux,
1322 int hyd_p_flag,
1323 cs_real_t f_ext[][3],
1324 cs_real_t viscel[][6],
1325 const cs_real_t weighb[],
1326 const cs_real_t pvar[]);
1327
1328/*----------------------------------------------------------------------------*/
1329/*
1330 * \brief Update face value for gradient and diffusion when solving
1331 * in increment.
1332 *
1333 * \param[in] ctx reference to dispatch context
1334 * \param[in] f pointer to field
1335 * \param[in] bc_coeffs boundary condition structure for the variable
1336 * \param[in] inc 0 if an increment, 1 otherwise
1337 * \param[in] halo_type halo type (extended or not)
1338 * \param[in] var variable values at cell centers
1339 * \param[in,out] var_ip boundary variable values at I' position
1340 * \param[in,out] var_f face values for the gradient computation
1341 * \param[in,out] var_f_d face values for the diffusion computation
1342 * \param[in,out] var_f_d_lim face values for the diffusion computation
1343 * (with limiter)
1344 */
1345/*----------------------------------------------------------------------------*/
1346
1347template <cs_lnum_t stride>
1348void
1350 (cs_dispatch_context &ctx,
1351 cs_field_t *f,
1352 const cs_field_bc_coeffs_t *bc_coeffs,
1353 const int inc,
1354 const cs_equation_param_t *eqp,
1355 const cs_real_t pvar[][stride],
1356 cs_real_t val_ip[][stride],
1357 cs_real_t val_f[][stride],
1358 cs_real_t flux[][stride],
1359 cs_real_t flux_lim[][stride]);
1360
1361/*----------------------------------------------------------------------------*/
1362/*
1363 * \brief Update boundary coefficient face values for gradient and diffusion
1364 * when solving for a given field.
1365 *
1366 * \param[in] ctx reference to dispatch context
1367 * \param[in, out] f pointer to field
1368 * \param[in] pvar variable values at cell centers
1369 */
1370/*----------------------------------------------------------------------------*/
1371
1372template <cs_lnum_t stride>
1373void
1375 (cs_dispatch_context &ctx,
1376 cs_field_t *f,
1377 const cs_real_t pvar[][stride]);
1378
1379/*----------------------------------------------------------------------------*/
1389/*----------------------------------------------------------------------------*/
1390
1391void
1393 (cs_field_bc_coeffs_t *bc_coeffs,
1394 cs_lnum_t n_b_faces,
1395 cs_lnum_t dim,
1396 cs_alloc_mode_t amode,
1397 bool limiter);
1398
1399/*----------------------------------------------------------------------------*/
1409/*----------------------------------------------------------------------------*/
1410
1411void
1413 cs_lnum_t n_b_faces,
1414 cs_lnum_t stride,
1415 cs_alloc_mode_t amode,
1416 bool limiter);
1417
1418/*----------------------------------------------------------------------------*/
1424/*----------------------------------------------------------------------------*/
1425
1426void
1428
1429#endif /* cplusplus */
1430
1431/*----------------------------------------------------------------------------*/
1432
1433#endif /* __CS_BOUNDARY_CONDITIONS_SET_COEFFS_H__ */
void bft_error(const char *const file_name, const int line_num, const int sys_error_code, const char *const format,...)
Calls the error handler (set by bft_error_handler_set() or default).
Definition: bft_error.cpp:193
Definition: cs_dispatch.h:1711
void cs_init_bc_coeffs_solve(cs_bc_coeffs_solve_t &c, cs_lnum_t n_b_faces, cs_lnum_t stride, cs_alloc_mode_t amode, bool limiter)
Initialize boundary condition coefficients solve arrays.
Definition: cs_boundary_conditions_set_coeffs.cpp:5172
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_generalized_dirichlet_vector(cs_real_t a[3], cs_real_t af[3], cs_real_t b[3][3], cs_real_t bf[3][3], const cs_real_t pimpv[3], const cs_real_t qimpv[3], cs_real_t hint, const cs_nreal_t normal[3])
Set generalized Dirichlet BC for a vector for a given face.
Definition: cs_boundary_conditions_set_coeffs.h:597
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_dirichlet_conv_neumann_diff_scalar(cs_real_t &a, cs_real_t &af, cs_real_t &b, cs_real_t &bf, cs_real_t pimp, cs_real_t dimp)
Imposed value for the convection operator, imposed flux for diffusion, for a scalar.
Definition: cs_boundary_conditions_set_coeffs.h:1233
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_neumann_scalar(cs_real_t &a, cs_real_t &af, cs_real_t &b, cs_real_t &bf, cs_real_t qimp, cs_real_t hint)
Set Neumann BC for a scalar for a given face.
Definition: cs_boundary_conditions_set_coeffs.h:993
void cs_boundary_conditions_set_coeffs(int nvar, int iterns, int isvhb, int italim, int itrfin, int ineefl, int itrfup, int isostd[], cs_real_t *visvdr, cs_real_t hbord[], cs_real_t theipb[], int nftcdt)
Translation of the boundary conditions given by the user in a form that fits to the solver.
Definition: cs_boundary_conditions_set_coeffs.cpp:758
void cs_clear_bc_coeffs_solve(cs_bc_coeffs_solve_t &c)
Free boundary condition coefficients solve arrays.
Definition: cs_boundary_conditions_set_coeffs.cpp:5204
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_affine_function_scalar(cs_real_t &a, cs_real_t &af, cs_real_t &b, cs_real_t &bf, cs_real_t pinf, cs_real_t ratio, cs_real_t hint)
Set BC for an affine scalar function for a given face.
Definition: cs_boundary_conditions_set_coeffs.h:1136
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_dirichlet_vector(cs_real_t a[3], cs_real_t af[3], cs_real_t b[3][3], cs_real_t bf[3][3], const cs_real_t pimpv[3], cs_real_t hint, const cs_real_t hextv[3])
Set Dirichlet BC for a vector for a given face.
Definition: cs_boundary_conditions_set_coeffs.h:299
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_convective_outlet_vector(cs_real_t a[3], cs_real_t af[3], cs_real_t b[3][3], cs_real_t bf[3][3], const cs_real_t pimpv[3], const cs_real_t cflv[3], cs_real_t hint)
Set convective outlet BC for a vector for a given face.
Definition: cs_boundary_conditions_set_coeffs.h:765
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_dirichlet_conv_neumann_diff_tensor(cs_real_t a[6], cs_real_t af[6], cs_real_t b[6][6], cs_real_t bf[6][6], const cs_real_t pimpts[6], const cs_real_t qimpts[6])
Imposed value for the convection operator, imposed flux for diffusion, for a tensor.
Definition: cs_boundary_conditions_set_coeffs.h:946
void cs_boundary_conditions_update_bc_coeff_face_values_strided(cs_dispatch_context &ctx, cs_field_t *f, const cs_field_bc_coeffs_t *bc_coeffs, const int inc, const cs_equation_param_t *eqp, const cs_real_t pvar[][stride], cs_real_t val_ip[][stride], cs_real_t val_f[][stride], cs_real_t flux[][stride], cs_real_t flux_lim[][stride])
Update face value for gradient and diffusion when solving in increments.
Definition: cs_boundary_conditions_set_coeffs.cpp:4751
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_dirichlet_scalar(cs_real_t &a, cs_real_t &af, cs_real_t &b, cs_real_t &bf, cs_real_t pimp, cs_real_t hint, cs_real_t hext)
Set Dirichlet BC for a scalar for a given face.
Definition: cs_boundary_conditions_set_coeffs.h:1051
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_neumann_vector_aniso(cs_real_t a[3], cs_real_t af[3], cs_real_t b[3][3], cs_real_t bf[3][3], const cs_real_t qimpv[3], const cs_real_t hint[6])
Set neumann BC for an anisotropic vector for a given face.
Definition: cs_boundary_conditions_set_coeffs.h:203
void cs_boundary_conditions_update_bc_coeff_face_values(cs_dispatch_context &ctx, const cs_field_t *f, const cs_field_bc_coeffs_t *bc_coeffs, const int inc, const cs_equation_param_t *eqp, const bool need_compute_bc_grad, const bool need_compute_bc_flux, int hyd_p_flag, cs_real_t f_ext[][3], cs_real_t visel[], cs_real_t viscel[][6], const cs_real_t weighb[], const cs_real_t pvar[], cs_real_t val_f[], cs_real_t flux[])
Update face value for gradient and diffusion when solving in increment.
Definition: cs_boundary_conditions_set_coeffs.cpp:4319
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_neumann_scalar_hmg(cs_real_t &a, cs_real_t &af, cs_real_t &b, cs_real_t &bf)
Set homogeneous Neumann BC for a scalar for a given face.
Definition: cs_boundary_conditions_set_coeffs.h:1021
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_dirichlet_tensor(cs_real_t a[6], cs_real_t af[6], cs_real_t b[6][6], cs_real_t bf[6][6], const cs_real_t pimpts[6], cs_real_t hint, const cs_real_t hextts[6])
Set Dirichlet BC for a tensor for a given face.
Definition: cs_boundary_conditions_set_coeffs.h:446
void cs_boundary_conditions_ensure_bc_coeff_face_values_allocated(cs_field_bc_coeffs_t *bc_coeffs, cs_lnum_t n_b_faces, cs_lnum_t dim, cs_alloc_mode_t amode, bool limiter)
Allocate BC coefficients face values if needed.
Definition: cs_boundary_conditions_set_coeffs.cpp:5128
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_neumann_tensor(cs_real_t a[6], cs_real_t af[6], cs_real_t b[6][6], cs_real_t bf[6][6], const cs_real_t qimpts[6], cs_real_t hint)
Set Neumann boundary conditions for a tensor for a given face.
Definition: cs_boundary_conditions_set_coeffs.h:258
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_dirichlet_vector_aniso(cs_real_t a[3], cs_real_t af[3], cs_real_t b[3][3], cs_real_t bf[3][3], const cs_real_t pimpv[3], const cs_real_t hintt[6], const cs_real_t hextv[3])
Set Dirichlet BC for a vector for a given face with left anisotropic diffusion.
Definition: cs_boundary_conditions_set_coeffs.h:388
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_affine_function_conv_neumann_diff_scalar(cs_real_t &a, cs_real_t &af, cs_real_t &b, cs_real_t &bf, cs_real_t pinf, cs_real_t ratio, cs_real_t dimp)
Set Neumann BC for the convection operator, imposed flux for diffusion.
Definition: cs_boundary_conditions_set_coeffs.h:1170
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_neumann_vector(cs_real_t a[3], cs_real_t af[3], cs_real_t b[3][3], cs_real_t bf[3][3], const cs_real_t qimpv[3], cs_real_t hint)
Set Neumann BC for a scalar for a given face.
Definition: cs_boundary_conditions_set_coeffs.h:162
CS_F_HOST_DEVICE void cs_boundary_conditions_set_generalized_dirichlet_vector_aniso(cs_real_t a[3], cs_real_t af[3], cs_real_t b[3][3], cs_real_t bf[3][3], const cs_real_t pimpv[3], const cs_real_t qimpv[3], const cs_real_t hint[6], const cs_nreal_t normal[3])
Set generalized Dirichlet BC for an anisotropic vector for a given face.
Definition: cs_boundary_conditions_set_coeffs.cpp:4216
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_convective_outlet_tensor(cs_real_t a[6], cs_real_t af[6], cs_real_t b[6][6], cs_real_t bf[6][6], const cs_real_t pimpts[6], const cs_real_t cflts[6], cs_real_t hint)
Set convective outlet BC for a tensor for a given face.
Definition: cs_boundary_conditions_set_coeffs.h:810
void cs_boundary_conditions_set_coeffs_init(void)
Initialization of boundary condition arrays.
Definition: cs_boundary_conditions_set_coeffs.cpp:3946
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_neumann_conv_h_neumann_diff_scalar(cs_real_t &a, cs_real_t &af, cs_real_t &b, cs_real_t &bf, cs_real_t dimp, cs_real_t hint)
Set Neumann BC for the convection operator, zero flux for diffusion.
Definition: cs_boundary_conditions_set_coeffs.h:1099
CS_F_HOST_DEVICE void cs_boundary_conditions_set_convective_outlet_scalar(cs_real_t &a, cs_real_t &af, cs_real_t &b, cs_real_t &bf, cs_real_t pimp, cs_real_t cfl, cs_real_t hint)
Set convective oulet boundary condition for a scalar.
Definition: cs_boundary_conditions_set_coeffs.cpp:4099
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_dirichlet_conv_neumann_diff_vector(cs_real_t a[3], cs_real_t af[3], cs_real_t b[3][3], cs_real_t bf[3][3], const cs_real_t pimpv[3], const cs_real_t qimpv[3])
Imposed value for the convection operator, imposed flux for diffusion, for a vector.
Definition: cs_boundary_conditions_set_coeffs.h:909
CS_F_HOST_DEVICE void cs_boundary_conditions_set_generalized_sym_vector_aniso(cs_real_t a[3], cs_real_t af[3], cs_real_t b[3][3], cs_real_t bf[3][3], const cs_real_t pimpv[3], const cs_real_t qimpv[3], const cs_real_t hint[6], const cs_nreal_t normal[3])
Set generalized BC for an anisotropic symmetric vector for a given face.
Definition: cs_boundary_conditions_set_coeffs.cpp:4134
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_generalized_dirichlet_sym_tensor(cs_real_t a[6], cs_real_t af[6], cs_real_t b[6][6], cs_real_t bf[6][6], const cs_real_t pimpv[6], const cs_real_t qimpv[6], cs_real_t hint, const cs_nreal_t normal[3])
Set generalized Dirichlet BC for a symmetric tensor for a given face.
Definition: cs_boundary_conditions_set_coeffs.h:655
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_convective_outlet_vector_aniso(cs_real_t a[3], cs_real_t af[3], cs_real_t b[3][3], cs_real_t bf[3][3], const cs_real_t pimpv[3], const cs_real_t cflv[3], const cs_real_t hintt[6])
Set convective outlet BC for an anisotropic vector for a given face.
Definition: cs_boundary_conditions_set_coeffs.h:856
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_total_flux(cs_real_t &a, cs_real_t &af, cs_real_t &b, cs_real_t &bf, cs_real_t hext, cs_real_t dimp)
Set total flux as a Robin condition.
Definition: cs_boundary_conditions_set_coeffs.h:1201
static CS_F_HOST_DEVICE void cs_boundary_conditions_set_generalized_sym_vector(cs_real_t a[3], cs_real_t af[3], cs_real_t b[3][3], cs_real_t bf[3][3], const cs_real_t pimpv[3], const cs_real_t qimpv[3], cs_real_t hint, const cs_nreal_t normal[3])
Set generalized BC for a symmetric vector for a given face.
Definition: cs_boundary_conditions_set_coeffs.h:514
#define BEGIN_C_DECLS
Definition: cs_defs.h:554
#define CS_F_HOST_DEVICE
Definition: cs_defs.h:585
double cs_real_t
Floating-point value.
Definition: cs_defs.h:357
#define _(String)
Definition: cs_defs.h:67
#define END_C_DECLS
Definition: cs_defs.h:555
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:350
double cs_nreal_t
Definition: cs_defs.h:361
@ k
Definition: cs_field_pointer.h:72
const cs_real_t cs_math_infinite_r
CS_F_HOST_DEVICE void cs_math_sym_33_3_product(const T m[6], const U v[3], V *restrict mv)
Compute the product of a symmetric matrix of 3x3 real values by a vector of 3 real values....
Definition: cs_math.h:301
cs_alloc_mode_t
Definition: cs_mem.h:50
CS_F_HOST_DEVICE T max(const T a, const T b)
Definition: cs_defs.h:769
Definition: cs_field.h:105
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:194
Field boundary condition descriptor (for variables)
Definition: cs_field.h:120
Field descriptor.
Definition: cs_field.h:156