Loading...
Searching...
No Matches
fvcSurfaceOps.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2024 M.Janssens
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28#include "fvcSurfaceOps.H"
29#include "fvMesh.H"
31
32// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33
34namespace Foam
35{
36
37// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39namespace fvc
40{
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44template<class Type, class ResultType, class CellToFaceOp>
45void surfaceSum
46(
47 const surfaceScalarField& lambdas,
49 const CellToFaceOp& cop,
52)
53{
54 const fvMesh& mesh = vf.mesh();
55 const auto& Sf = mesh.Sf();
56 const auto& P = mesh.owner();
57 const auto& N = mesh.neighbour();
58 const auto& pbm = mesh.boundaryMesh();
59
60 const auto& vfi = vf.primitiveField();
61 auto& sfi = result.primitiveFieldRef();
62
63 // See e.g. surfaceInterpolationScheme<Type>::dotInterpolate
64
65 // Fetch patchNeighbourField or value onto end of vf
66 bitSet isCoupled(vf.boundaryField().size());
67
68 const label oldSize = vf.constCast().boundaryEvaluate
69 (
70 [&](const auto& pfld, UList<Type>& slice)
71 {
72 if (pfld.coupled())
73 {
74 pfld.patchNeighbourField(slice);
75 isCoupled.set(pfld.patch().index());
76 }
77 else
78 {
79 SubList<Type>(slice, pfld.size()) = pfld;
80 }
81 }
82 );
83
84 // Internal field
85 const auto& Sfi = Sf.primitiveField();
86 const auto& lambda = lambdas.primitiveField();
87
88 #if 0
89 {
90 //- Example of cell-loop instead of face-loop
91 const auto& cells = mesh.cells();
92 const label nCells = mesh.nCells();
93 const label nIntFaces = mesh.nInternalFaces();
94 const auto& patchID = pbm.patchID();
95 for (label celli = 0; celli < nCells; celli++)
96 {
97 const auto& cFaces = cells[celli];
98 auto& res = sfi[celli];
99 res = Zero;
100 for (const label facei : cFaces)
101 {
102 if (facei < nIntFaces)
103 {
104 ResultType faceVal
105 (
106 cop
107 (
108 Sfi[facei],
109 lambda[facei],
110 vfi[P[facei]],
111 vfi[N[facei]]
112 )
113 );
114 if (P[facei] != celli)
115 {
116 faceVal = -faceVal;
117 }
118 sfi[celli] += faceVal;
119 }
120 else
121 {
122 const label patchi = patchID[facei-nIntFaces];
123 const label patchFacei = facei-pbm[patchi].start();
124 const label offset = nCells+pbm[patchi].offset();
125 const auto& pSf = Sf.boundaryField()[patchi];
126 const auto& pLambda = lambdas.boundaryField()[patchi];
127
128 if (isCoupled(patchi))
129 {
130 // Interpolate between owner-side and neighbour-side values
131 const ResultType faceVal
132 (
133 cop
134 (
135 pSf[patchFacei],
136 pLambda[patchFacei],
137 vfi[celli],
138 vfi[offset+patchFacei]
139 )
140 );
141 sfi[celli] += faceVal;
142 }
143 else if (pSf.size())
144 {
145 // Use patch value only
146 const ResultType faceVal
147 (
148 cop
149 (
150 pSf[patchFacei],
151 scalar(1.0),
152 vfi[offset+patchFacei],
153 pTraits<Type>::zero // not used
154 )
155 );
156 sfi[celli] += faceVal;
157 }
158 }
159 }
160 }
161 }
162 #else
163 {
164 for (label facei=0; facei<P.size(); facei++)
165 {
166 const label ownCelli = P[facei];
167 const label neiCelli = N[facei];
168
169 const ResultType faceVal
170 (
171 cop
172 (
173 Sfi[facei],
174 lambda[facei],
175 vfi[ownCelli],
176 vfi[neiCelli]
177 )
178 );
179 sfi[ownCelli] += faceVal;
180 sfi[neiCelli] -= faceVal;
181 }
182
183 // Boundary field
184 forAll(mesh.boundary(), patchi)
185 {
186 const auto& pFaceCells = mesh.boundary()[patchi].faceCells();
187 const label offset = mesh.nCells()+pbm[patchi].offset();
188 const auto& pSf = Sf.boundaryField()[patchi];
189 const auto& pLambda = lambdas.boundaryField()[patchi];
190
191 if (isCoupled(patchi))
192 {
193 //auto tpnf(pvf.patchNeighbourField());
194 //auto& pnf = tpnf();
195
196 for (label facei=0; facei<pFaceCells.size(); facei++)
197 {
198 // Interpolate between owner-side and neighbour-side values
199 const ResultType faceVal
200 (
201 cop
202 (
203 pSf[facei],
204 pLambda[facei],
205 vfi[pFaceCells[facei]],
206 //pnf[facei]
207 vfi[offset+facei]
208 )
209 );
210 sfi[pFaceCells[facei]] += faceVal;
211 }
212 }
213 else
214 {
215 for (label facei=0; facei<pFaceCells.size(); facei++)
216 {
217 // Use patch value only
218 const ResultType faceVal
219 (
220 cop
221 (
222 pSf[facei],
223 scalar(1.0),
224 vfi[offset+facei],
225 pTraits<Type>::zero // not used
226 )
227 );
228 sfi[pFaceCells[facei]] += faceVal;
229 }
230 }
231 }
232 }
233 #endif
234
235 // Restore original size
236 vf.constCast().resize(oldSize);
237
239 {
242}
243
244
245template<class Type, class FType, class ResultType, class CellToFaceOp>
246void surfaceSum
247(
248 const surfaceScalarField& lambdas,
249 const GeometricField<Type, fvPatchField, volMesh>& vf,
250 const GeometricField<FType, fvsPatchField, surfaceMesh>& sadd,
251 const CellToFaceOp& cop,
252 GeometricField<ResultType, fvPatchField, volMesh>& result,
254)
255{
256 const fvMesh& mesh = vf.mesh();
257 const auto& Sf = mesh.Sf();
258 const auto& P = mesh.owner();
259 const auto& N = mesh.neighbour();
260
261 const auto& vfi = vf.primitiveField();
262 auto& sfi = result.primitiveFieldRef();
263
264 // See e.g. surfaceInterpolationScheme<Type>::dotInterpolate
265
266 // Internal field
267 {
268 const auto& Sfi = Sf.primitiveField();
269 const auto& lambda = lambdas.primitiveField();
270 const auto& saddi = sadd.primitiveField();
271
272 for (label facei=0; facei<P.size(); facei++)
273 {
274 const label ownCelli = P[facei];
275 const label neiCelli = N[facei];
276
277 const ResultType faceVal
278 (
279 cop
280 (
281 Sfi[facei],
282 lambda[facei],
283 vfi[ownCelli],
284 vfi[neiCelli],
285
286 saddi[facei] // additional face value
287 )
288 );
289 sfi[ownCelli] += faceVal;
290 sfi[neiCelli] -= faceVal;
291 }
292 }
293
294
295 // Boundary field
296 {
297 // Fetch patchNeighbourField onto end of GeoField
298 const label oldSize = vf.constCast().boundaryEvaluate
299 (
300 [](const auto& pfld, UList<Type>& slice)
301 {
302 if (pfld.coupled())
303 {
304 pfld.patchNeighbourField(slice);
305 }
306 }
307 );
308
309 forAll(mesh.boundary(), patchi)
310 {
311 const auto& pFaceCells = mesh.boundary()[patchi].faceCells();
312 const auto& pSf = Sf.boundaryField()[patchi];
313 const auto& pvf = vf.boundaryField()[patchi];
314 const auto& pLambda = lambdas.boundaryField()[patchi];
315 const auto& psadd = sadd.boundaryField()[patchi];
316
317 if (pvf.coupled())
318 {
319 //auto tpnf(pvf.patchNeighbourField());
320 //auto& pnf = tpnf();
321
322 const label offset = mesh.nCells()+pvf.patch().offset();
323
324 for (label facei=0; facei<pFaceCells.size(); facei++)
325 {
326 // Interpolate between owner-side and neighbour-side values
327 const ResultType faceVal
328 (
329 cop
330 (
331 pSf[facei],
332 pLambda[facei],
333 vfi[pFaceCells[facei]],
334 //pnf[facei],
335 vfi[offset+facei],
336 psadd[facei]
337 )
338 );
339 sfi[pFaceCells[facei]] += faceVal;
340 }
341 }
342 else
343 {
344 for (label facei=0; facei<pFaceCells.size(); facei++)
345 {
346 // Use patch value only
347 const ResultType faceVal
348 (
349 cop
350 (
351 pSf[facei],
352 scalar(1.0),
353 pvf[facei],
354 pTraits<Type>::zero, // not used
355
356 psadd[facei]
357 )
358 );
359 sfi[pFaceCells[facei]] += faceVal;
360 }
361 }
362 }
363
364 // Restore original size
365 vf.constCast().resize(oldSize);
366 }
367
369 {
370 result.correctBoundaryConditions();
371 }
372}
373
374
375template
376<
377 class Type,
378 class FType0,
379 class FType1,
380 class ResultType,
381 class CellToFaceOp
382>
383void surfaceSum
384(
385 const surfaceScalarField& lambdas,
387
390
391 const CellToFaceOp& cop,
394)
395{
396 const fvMesh& mesh = vf.mesh();
397 const auto& Sf = mesh.Sf();
398 const auto& P = mesh.owner();
399 const auto& N = mesh.neighbour();
400
401 const auto& vfi = vf.primitiveField();
402 auto& resulti = result.primitiveFieldRef();
403
404 // See e.g. surfaceInterpolationScheme<Type>::dotInterpolate
405
406 // Internal field
407 {
408 const auto& Sfi = Sf.primitiveField();
409 const auto& lambda = lambdas.primitiveField();
410 const auto& sf0i = sf0.primitiveField();
411 const auto& sf1i = sf1.primitiveField();
412
413 for (label facei=0; facei<P.size(); facei++)
414 {
415 const label ownCelli = P[facei];
416 const label neiCelli = N[facei];
417
418 const ResultType faceVal
419 (
420 cop
421 (
422 Sfi[facei],
423
424 lambda[facei],
425 vfi[ownCelli],
426 vfi[neiCelli],
427
428 sf0i[facei], // additional face value
429 sf1i[facei] // additional face value
430 )
431 );
432 resulti[ownCelli] += faceVal;
433 resulti[neiCelli] -= faceVal;
434 }
435 }
436
437
438 // Boundary field
439 {
440 // Fetch patchNeighbourField onto end of GeoField
441 const label oldSize = vf.constCast().boundaryEvaluate
442 (
443 [](const auto& pfld, UList<Type>& slice)
444 {
445 if (pfld.coupled())
446 {
447 pfld.patchNeighbourField(slice);
448 }
449 }
450 );
451
452 forAll(mesh.boundary(), patchi)
453 {
454 const auto& pFaceCells = mesh.boundary()[patchi].faceCells();
455 const auto& pSf = Sf.boundaryField()[patchi];
456 const auto& pvf = vf.boundaryField()[patchi];
457 const auto& pLambda = lambdas.boundaryField()[patchi];
458 const auto& psf0 = sf0.boundaryField()[patchi];
459 const auto& psf1 = sf1.boundaryField()[patchi];
460
461 if (pvf.coupled())
462 {
463 //auto tpnf(pvf.patchNeighbourField());
464 //auto& pnf = tpnf();
465
466 const label offset = mesh.nCells()+pvf.patch().offset();
467
468 for (label facei=0; facei<pFaceCells.size(); facei++)
469 {
470 // Interpolate between owner-side and neighbour-side values
471 const ResultType faceVal
472 (
473 cop
474 (
475 pSf[facei],
476
477 pLambda[facei],
478 vfi[pFaceCells[facei]],
479 //pnf[facei],
480 vfi[offset+facei],
481
482 psf0[facei],
483 psf1[facei]
484 )
485 );
486
487 resulti[pFaceCells[facei]] += faceVal;
488 }
489 }
490 else
491 {
492 for (label facei=0; facei<pFaceCells.size(); facei++)
493 {
494 // Use patch value only
495 const ResultType faceVal
496 (
497 cop
498 (
499 pSf[facei],
500 scalar(1.0),
501 pvf[facei],
502 pTraits<Type>::zero, // not used
503
504 psf0[facei],
505 psf1[facei]
506 )
507 );
508
509 resulti[pFaceCells[facei]] += faceVal;
510 }
511 }
512 }
513
514 // Restore original size
515 vf.constCast().resize(oldSize);
516 }
517
519 {
522}
523
524
525template<class Type, class ResultType, class CombineOp>
526void GaussOp
527(
528 const surfaceScalarField& lambdas,
529 const GeometricField<Type, fvPatchField, volMesh>& vf,
530 const CombineOp& cop,
531 GeometricField<ResultType, fvPatchField, volMesh>& result
532)
533{
534 const fvMesh& mesh = vf.mesh();
535
536 // Sum contributions
537 surfaceSum(lambdas, vf, cop, result, false);
538
539 auto& sfi = result.primitiveFieldRef();
540 sfi /= mesh.V();
541
542 result.correctBoundaryConditions();
543}
544
545
546template<class Type, class ResultType, class CombineOp>
547void surfaceOp
548(
550 const surfaceVectorField& ownLs,
551 const surfaceVectorField& neiLs,
552 const CombineOp& cop,
554)
555{
556 const fvMesh& mesh = vf.mesh();
557 const auto& Sf = mesh.Sf();
558 const auto& P = mesh.owner();
559 const auto& N = mesh.neighbour();
560
561 const auto& vfi = vf.primitiveField();
562 auto& sfi = result.primitiveFieldRef();
563
564 // Internal field
565 {
566 const auto& Sfi = Sf.primitiveField();
567
568 for (label facei=0; facei<P.size(); facei++)
569 {
570 const label ownCelli = P[facei];
571 const label neiCelli = N[facei];
572
573 const Type faceVal
574 (
575 cop
576 (
577 Sfi[facei], // needed?
578 vfi[ownCelli],
579 vfi[neiCelli]
580 )
581 );
582 sfi[ownCelli] += ownLs[facei]*faceVal;
583 sfi[neiCelli] -= neiLs[facei]*faceVal;
584 }
585 }
586
587
588 // Boundary field
589 {
590 // Fetch patchNeighbourField onto end of GeoField
591 const label oldSize = vf.constCast().boundaryEvaluate
592 (
593 [](const auto& pfld, UList<Type>& slice)
594 {
595 if (pfld.coupled())
596 {
597 pfld.patchNeighbourField(slice);
598 }
599 }
600 );
601
602 forAll(mesh.boundary(), patchi)
603 {
604 const auto& pFaceCells = mesh.boundary()[patchi].faceCells();
605 const auto& pSf = Sf.boundaryField()[patchi];
606 const auto& pvf = vf.boundaryField()[patchi];
607 const auto& pOwnLs = ownLs.boundaryField()[patchi];
608
609 if (pvf.coupled())
610 {
611 //auto tpnf(pvf.patchNeighbourField());
612 //auto& pnf = tpnf();
613
614 const label offset = mesh.nCells()+pvf.patch().offset();
615
616 for (label facei=0; facei<pFaceCells.size(); facei++)
617 {
618 const Type faceVal
619 (
620 cop
621 (
622 pSf[facei], // needed?
623 vfi[pFaceCells[facei]],
624 //pnf[facei]
625 vfi[offset+facei]
626 )
627 );
628 sfi[pFaceCells[facei]] += pOwnLs[facei]*faceVal;
629 }
630 }
631 else
632 {
633 for (label facei=0; facei<pFaceCells.size(); facei++)
634 {
635 const Type faceVal
636 (
637 cop
638 (
639 pSf[facei],
640 vfi[pFaceCells[facei]],
641 pvf[facei]
642 )
643 );
644 sfi[pFaceCells[facei]] += pOwnLs[facei]*faceVal;
645 }
646 }
647 }
648
649 // Restore original size
650 vf.constCast().resize(oldSize);
651 }
652
654}
655
656
657template<class Type, class ResultType, class CellToFaceOp>
658void surfaceSnSum
659(
660 const surfaceScalarField& deltaCoeffs,
662
663 const CellToFaceOp& cop,
664
667)
668{
669 const fvMesh& mesh = vf.mesh();
670 const auto& Sf = mesh.Sf();
671 const auto& P = mesh.owner();
672 const auto& N = mesh.neighbour();
673
674 const auto& vfi = vf.primitiveField();
675 auto& sfi = result.primitiveFieldRef();
676
677 // Internal field
678 {
679 const auto& Sfi = Sf.primitiveField();
680 const auto& dc = deltaCoeffs.primitiveField();
681
682 for (label facei=0; facei<P.size(); facei++)
683 {
684 const label ownCelli = P[facei];
685 const label neiCelli = N[facei];
686
687 const ResultType faceVal
688 (
689 cop
690 (
691 Sfi[facei], // area vector
692 dc[facei], // delta coefficients
693 vfi[ownCelli],
694 vfi[neiCelli]
695 )
696 );
697 sfi[ownCelli] += faceVal;
698 sfi[neiCelli] -= faceVal;
699 }
700 }
701
702
703 // Boundary field
704 {
705 const label oldSize = vf.constCast().boundaryEvaluate
706 (
707 [](const auto& pfld, UList<Type>& slice)
708 {
709 if (pfld.coupled())
710 {
711 pfld.patchNeighbourField(slice);
712 }
713 else
714 {
715 pfld.snGrad(slice);
716 }
717 }
718 );
719
720 forAll(mesh.boundary(), patchi)
721 {
722 const auto& pFaceCells = mesh.boundary()[patchi].faceCells();
723 const auto& pSf = Sf.boundaryField()[patchi];
724 const auto& pvf = vf.boundaryField()[patchi];
725 const auto& pdc = deltaCoeffs.boundaryField()[patchi];
726
727 const label offset = mesh.nCells()+pvf.patch().offset();
728
729 if (pvf.coupled())
730 {
731 //auto tpnf(pvf.patchNeighbourField());
732 //auto& pnf = tpnf();
733
734 for (label facei=0; facei<pFaceCells.size(); facei++)
735 {
736 const label ownCelli = pFaceCells[facei];
737
738 // Interpolate between owner-side and neighbour-side values
739 const ResultType faceVal
740 (
741 cop
742 (
743 pSf[facei], // area vector
744 pdc[facei],
745 vfi[ownCelli],
746 //pnf[facei]
747 vfi[offset+facei]
748 )
749 );
750 sfi[ownCelli] += faceVal;
751 }
752 }
753 else
754 {
755 //auto tpnf(pvf.snGrad());
756 //auto& pnf = tpnf();
757
758 for (label facei=0; facei<pFaceCells.size(); facei++)
759 {
760 const label ownCelli = pFaceCells[facei];
761
762 // Use patch value only
763 const ResultType faceVal
764 (
765 cop
766 (
767 pSf[facei], // area vector
768 scalar(1.0), // use 100% of pnf
769 pTraits<Type>::zero,
770 //pnf[facei]
771 vfi[offset+facei]
772 )
773 );
774 sfi[ownCelli] += faceVal;
775 }
776 }
777 }
778
779 // Restore original size
780 vf.constCast().resize(oldSize);
781 }
782
784 {
787}
788
789
790template<class Type, class ResultType, class CellToFaceOp>
791void surfaceSnSum
792(
793 const surfaceScalarField& deltaCoeffs,
794 const GeometricField<Type, fvPatchField, volMesh>& vf,
795 const GeometricField<Type, fvsPatchField, surfaceMesh>& sadd,
796
797 const CellToFaceOp& cop,
798
799 GeometricField<ResultType, fvPatchField, volMesh>& result,
801)
802{
803 const fvMesh& mesh = vf.mesh();
804 const auto& Sf = mesh.Sf();
805 const auto& P = mesh.owner();
806 const auto& N = mesh.neighbour();
807
808 const auto& vfi = vf.primitiveField();
809 auto& sfi = result.primitiveFieldRef();
810
811 // Internal field
812 {
813 const auto& Sfi = Sf.primitiveField();
814 const auto& dc = deltaCoeffs.primitiveField();
815 const auto& saddi = sadd.primitiveField();
816
817 for (label facei=0; facei<P.size(); facei++)
818 {
819 const label ownCelli = P[facei];
820 const label neiCelli = N[facei];
821
822 const ResultType faceVal
823 (
824 cop
825 (
826 Sfi[facei], // area vector
827 dc[facei], // delta coefficients
828 vfi[ownCelli],
829 vfi[neiCelli],
830 saddi[facei] // face addition value
831 )
832 );
833 sfi[ownCelli] += faceVal;
834 sfi[neiCelli] -= faceVal;
835 }
836 }
837
838
839 // Boundary field
840 {
841 // Fetch patchNeighbourField onto end of GeoField
842 const label oldSize = vf.constCast().boundaryEvaluate
843 (
844 [](const auto& pfld, UList<Type>& slice)
845 {
846 if (pfld.coupled())
847 {
848 pfld.patchNeighbourField(slice);
849 }
850 else
851 {
852 pfld.snGrad(slice);
853 }
854 }
855 );
856
857 forAll(mesh.boundary(), patchi)
858 {
859 const auto& pFaceCells = mesh.boundary()[patchi].faceCells();
860 const auto& pSf = Sf.boundaryField()[patchi];
861 const auto& pvf = vf.boundaryField()[patchi];
862 const auto& pdc = deltaCoeffs.boundaryField()[patchi];
863 const auto& psadd = sadd.boundaryField()[patchi];
864
865 const label offset = mesh.nCells()+pvf.patch().offset();
866
867 if (pvf.coupled())
868 {
869 //auto tpnf(pvf.patchNeighbourField());
870 //auto& pnf = tpnf();
871
872 for (label facei=0; facei<pFaceCells.size(); facei++)
873 {
874 const label ownCelli = pFaceCells[facei];
875
876 // Interpolate between owner-side and neighbour-side values
877 const ResultType faceVal
878 (
879 cop
880 (
881 pSf[facei], // area vector
882 pdc[facei],
883 vfi[ownCelli],
884 //pnf[facei],
885 vfi[offset+facei],
886 psadd[facei]
887 )
888 );
889 sfi[ownCelli] += faceVal;
890 }
891 }
892 else
893 {
894 //auto tpnf(pvf.snGrad());
895 //auto& pnf = tpnf();
896
897 for (label facei=0; facei<pFaceCells.size(); facei++)
898 {
899 const label ownCelli = pFaceCells[facei];
900
901 // Use patch value only
902 const ResultType faceVal
903 (
904 cop
905 (
906 pSf[facei], // area vector
907 scalar(1.0), // use 100% of pnf
908 pTraits<Type>::zero,
909 //pnf[facei],
910 vfi[offset+facei],
911 psadd[facei]
912 )
913 );
914 sfi[ownCelli] += faceVal;
915 }
916 }
917 }
918
919 // Restore original size
920 vf.constCast().resize(oldSize);
921 }
922
924 {
925 result.correctBoundaryConditions();
927}
928
929
930template<class Type, class GType, class ResultType, class CellToFaceOp>
931void surfaceSnSum
932(
933 const surfaceScalarField& gammaWeights,
934 const GeometricField<GType, fvPatchField, volMesh>& gamma,
935
936 const surfaceScalarField& deltaCoeffs,
937 const GeometricField<Type, fvPatchField, volMesh>& vf,
938
939 const CellToFaceOp& cop,
940
941 GeometricField<ResultType, fvPatchField, volMesh>& result,
943)
944{
945 const fvMesh& mesh = vf.mesh();
946 const auto& Sf = mesh.Sf();
947 const auto& P = mesh.owner();
948 const auto& N = mesh.neighbour();
949
950 const auto& gammai = gamma.primitiveField();
951 const auto& vfi = vf.primitiveField();
952 auto& sfi = result.primitiveFieldRef();
953
954 // Internal field
955 {
956 const auto& Sfi = Sf.primitiveField();
957 const auto& weights = gammaWeights.primitiveField();
958 const auto& dc = deltaCoeffs.primitiveField();
959
960 for (label facei=0; facei<P.size(); facei++)
961 {
962 const label ownCelli = P[facei];
963 const label neiCelli = N[facei];
964
965 const ResultType faceVal
966 (
967 cop
968 (
969 Sfi[facei], // area vector
970
971 weights[facei], // interpolation weights
972 gammai[ownCelli],
973 gammai[neiCelli],
974
975 dc[facei], // delta coefficients
976 vfi[ownCelli],
977 vfi[neiCelli]
978 )
979 );
980 sfi[ownCelli] += faceVal;
981 sfi[neiCelli] -= faceVal;
982 }
983 }
984
985
986 // Boundary field
987 {
988 // Fetch patchNeighbourField onto end of GeoField
989 const label oldSize = vf.constCast().boundaryEvaluate
990 (
991 [](const auto& pfld, UList<Type>& slice)
992 {
993 if (pfld.coupled())
994 {
995 pfld.patchNeighbourField(slice);
996 }
997 else
998 {
999 pfld.snGrad(slice);
1000 }
1001 }
1002 );
1003
1004 (void) gamma.constCast().boundaryEvaluate
1005 (
1006 [](const auto& pfld, UList<GType>& slice)
1007 {
1008 if (pfld.coupled())
1009 {
1010 pfld.patchNeighbourField(slice);
1011 }
1012 }
1013 );
1014
1015 forAll(mesh.boundary(), patchi)
1016 {
1017 const auto& pFaceCells = mesh.boundary()[patchi].faceCells();
1018 const auto& pSf = Sf.boundaryField()[patchi];
1019 const auto& pvf = vf.boundaryField()[patchi];
1020 const auto& pdc = deltaCoeffs.boundaryField()[patchi];
1021 const auto& pweights = gammaWeights.boundaryField()[patchi];
1022 const auto& pgamma = gamma.boundaryField()[patchi];
1023
1024 const label offset = mesh.nCells()+pvf.patch().offset();
1025
1026 if (pvf.coupled())
1027 {
1028 //auto tpnf(pvf.patchNeighbourField());
1029 //auto& pnf = tpnf();
1030 //auto tgammanf(pgamma.patchNeighbourField());
1031 //auto& gammanf = tgammanf();
1032
1033 for (label facei=0; facei<pFaceCells.size(); facei++)
1034 {
1035 const label ownCelli = pFaceCells[facei];
1036
1037 // Interpolate between owner-side and neighbour-side values
1038 const ResultType faceVal
1039 (
1040 cop
1041 (
1042 pSf[facei], // area vector
1043
1044 pweights[facei],
1045 gammai[ownCelli],
1046 //gammanf[facei],
1047 gammai[offset+facei],
1048
1049 pdc[facei],
1050 vfi[ownCelli],
1051 //pnf[facei]
1052 vfi[offset+facei]
1053 )
1054 );
1055 sfi[ownCelli] += faceVal;
1056 }
1057 }
1058 else
1059 {
1060 //auto tpnf(pvf.snGrad());
1061 //auto& pnf = tpnf();
1062
1063 for (label facei=0; facei<pFaceCells.size(); facei++)
1064 {
1065 const label ownCelli = pFaceCells[facei];
1066
1067 // Use patch value only
1068 const ResultType faceVal
1069 (
1070 cop
1071 (
1072 pSf[facei], // area vector
1073
1074 scalar(1.0),
1075 pgamma[facei],
1076 pTraits<GType>::zero, // not used
1077
1078
1079 scalar(1.0), // use 100% of pnf
1080 pTraits<Type>::zero,
1081 //pnf[facei]
1082 vfi[offset+facei]
1083 )
1084 );
1085 sfi[ownCelli] += faceVal;
1086 }
1087 }
1088 }
1089
1090 // Restore original size
1091 vf.constCast().resize(oldSize);
1092 gamma.constCast().resize(oldSize);
1093 }
1094
1096 {
1097 result.correctBoundaryConditions();
1099}
1100
1101
1102template<class Type, class GType, class ResultType, class CellToFaceOp>
1103void surfaceSnSum
1104(
1105 const surfaceScalarField& gammaWeights,
1106 const GeometricField<GType, fvPatchField, volMesh>& gamma,
1107
1108 const surfaceScalarField& deltaCoeffs,
1109 const GeometricField<Type, fvPatchField, volMesh>& vf,
1110
1111 const GeometricField<Type, fvsPatchField, surfaceMesh>& sadd,
1112
1113 const CellToFaceOp& cop,
1114
1115 GeometricField<ResultType, fvPatchField, volMesh>& result,
1117)
1118{
1119 const fvMesh& mesh = vf.mesh();
1120 const auto& Sf = mesh.Sf();
1121 const auto& P = mesh.owner();
1122 const auto& N = mesh.neighbour();
1123
1124 const auto& gammai = gamma.primitiveField();
1125 const auto& vfi = vf.primitiveField();
1126 auto& sfi = result.primitiveFieldRef();
1127
1128 // Internal field
1129 {
1130 const auto& Sfi = Sf.primitiveField();
1131 const auto& weights = gammaWeights.primitiveField();
1132 const auto& dc = deltaCoeffs.primitiveField();
1133 const auto& saddi = sadd.primitiveField();
1134
1135 for (label facei=0; facei<P.size(); facei++)
1136 {
1137 const label ownCelli = P[facei];
1138 const label neiCelli = N[facei];
1139
1140 const ResultType faceVal
1141 (
1142 cop
1143 (
1144 Sfi[facei], // area vector
1145
1146 weights[facei], // interpolation weights
1147 gammai[ownCelli],
1148 gammai[neiCelli],
1149
1150 dc[facei], // delta coefficients
1151 vfi[ownCelli],
1152 vfi[neiCelli],
1153
1154 saddi[facei] // face addition value
1155 )
1156 );
1157 sfi[ownCelli] += faceVal;
1158 sfi[neiCelli] -= faceVal;
1159 }
1160 }
1161
1162
1163 // Boundary field
1164 {
1165 // Fetch patchNeighbourField onto end of GeoField
1166 const label oldSize = vf.constCast().boundaryEvaluate
1167 (
1168 [](const auto& pfld, UList<Type>& slice)
1169 {
1170 if (pfld.coupled())
1171 {
1172 pfld.patchNeighbourField(slice);
1173 }
1174 else
1175 {
1176 pfld.snGrad(slice);
1177 }
1178 }
1179 );
1180
1181 (void) gamma.constCast().boundaryEvaluate
1182 (
1183 [](const auto& pfld, UList<GType>& slice)
1184 {
1185 if (pfld.coupled())
1186 {
1187 pfld.patchNeighbourField(slice);
1188 }
1189 }
1190 );
1191
1192 forAll(mesh.boundary(), patchi)
1193 {
1194 const auto& pFaceCells = mesh.boundary()[patchi].faceCells();
1195 const auto& pSf = Sf.boundaryField()[patchi];
1196 const auto& pvf = vf.boundaryField()[patchi];
1197 const auto& pdc = deltaCoeffs.boundaryField()[patchi];
1198 const auto& pweights = gammaWeights.boundaryField()[patchi];
1199 const auto& pgamma = gamma.boundaryField()[patchi];
1200 const auto& psadd = sadd.boundaryField()[patchi];
1201
1202 const label offset = mesh.nCells()+pvf.patch().offset();
1203
1204 if (pvf.coupled())
1205 {
1206 for (label facei=0; facei<pFaceCells.size(); facei++)
1207 {
1208 const label ownCelli = pFaceCells[facei];
1209
1210 // Interpolate between owner-side and neighbour-side values
1211 const ResultType faceVal
1212 (
1213 cop
1214 (
1215 pSf[facei], // area vector
1216
1217 pweights[facei],
1218 gammai[ownCelli],
1219 //gammanf[facei],
1220 gammai[offset+facei],
1221
1222 pdc[facei],
1223 vfi[ownCelli],
1224 //pnf[facei],
1225 vfi[offset+facei],
1226
1227 psadd[facei]
1228 )
1229 );
1230 sfi[ownCelli] += faceVal;
1231 }
1232 }
1233 else
1234 {
1235 //auto tpnf(pvf.snGrad());
1236 //auto& pnf = tpnf();
1237
1238 for (label facei=0; facei<pFaceCells.size(); facei++)
1239 {
1240 const label ownCelli = pFaceCells[facei];
1241
1242 // Use patch value only
1243 const ResultType faceVal
1244 (
1245 cop
1246 (
1247 pSf[facei], // area vector
1248
1249 scalar(1.0),
1250 pgamma[facei],
1251 pTraits<GType>::zero, // not used
1252
1253
1254 scalar(1.0), // use 100% of pnf
1255 pTraits<Type>::zero,
1256 //pnf[facei],
1257 vfi[offset+facei],
1258
1259 psadd[facei]
1260 )
1261 );
1262 sfi[ownCelli] += faceVal;
1263 }
1264 }
1265 }
1266
1267 // Restore original size
1268 vf.constCast().resize(oldSize);
1269 gamma.constCast().resize(oldSize);
1270 }
1271
1273 {
1274 result.correctBoundaryConditions();
1275 }
1276}
1277
1278
1279template
1280<
1281 class Type,
1282 class GType0,
1283 class GType1,
1284 class ResultType,
1285 class CellToFaceOp
1286>
1287void surfaceSnSum
1288(
1289 const surfaceScalarField& gammaWeights,
1292
1293 const surfaceScalarField& deltaCoeffs,
1295
1296 const CellToFaceOp& cop,
1297
1300)
1301{
1302 const fvMesh& mesh = vf.mesh();
1303 const auto& Sf = mesh.Sf();
1304 const auto& P = mesh.owner();
1305 const auto& N = mesh.neighbour();
1306
1307 const auto& gamma0i = gamma0.primitiveField();
1308 const auto& gamma1i = gamma1.primitiveField();
1309 const auto& vfi = vf.primitiveField();
1310 auto& sfi = result.primitiveFieldRef();
1311
1312 // Internal field
1313 {
1314 const auto& Sfi = Sf.primitiveField();
1315 const auto& weights = gammaWeights.primitiveField();
1316 const auto& dc = deltaCoeffs.primitiveField();
1317
1318 for (label facei=0; facei<P.size(); facei++)
1319 {
1320 const label ownCelli = P[facei];
1321 const label neiCelli = N[facei];
1322
1323 const ResultType faceVal
1324 (
1325 cop
1326 (
1327 Sfi[facei], // area vector
1328
1329 weights[facei], // interpolation weights
1330
1331 gamma0i[ownCelli],
1332 gamma0i[neiCelli],
1333
1334 gamma1i[ownCelli],
1335 gamma1i[neiCelli],
1336
1337 dc[facei], // delta coefficients
1338 vfi[ownCelli],
1339 vfi[neiCelli]
1340 )
1341 );
1342 sfi[ownCelli] += faceVal;
1343 sfi[neiCelli] -= faceVal;
1344 }
1345 }
1346
1347
1348 // Boundary field
1349 {
1350 // Fetch patchNeighbourField onto end of GeoField
1351 const label oldSize = vf.constCast().boundaryEvaluate
1352 (
1353 [](const auto& pfld, UList<Type>& slice)
1354 {
1355 if (pfld.coupled())
1356 {
1357 pfld.patchNeighbourField(slice);
1358 }
1359 else
1360 {
1361 pfld.snGrad(slice);
1362 }
1363 }
1364 );
1365
1366 (void) gamma0.constCast().boundaryEvaluate
1367 (
1368 [](const auto& pfld, UList<GType0>& slice)
1369 {
1370 if (pfld.coupled())
1371 {
1372 pfld.patchNeighbourField(slice);
1373 }
1374 }
1375 );
1376
1377 (void) gamma1.constCast().boundaryEvaluate
1378 (
1379 [](const auto& pfld, UList<GType1>& slice)
1380 {
1381 if (pfld.coupled())
1382 {
1383 pfld.patchNeighbourField(slice);
1384 }
1385 }
1386 );
1387
1388 forAll(mesh.boundary(), patchi)
1389 {
1390 const auto& pFaceCells = mesh.boundary()[patchi].faceCells();
1391 const auto& pSf = Sf.boundaryField()[patchi];
1392 const auto& pvf = vf.boundaryField()[patchi];
1393 const auto& pdc = deltaCoeffs.boundaryField()[patchi];
1394 const auto& pweights = gammaWeights.boundaryField()[patchi];
1395 const auto& pgamma0 = gamma0.boundaryField()[patchi];
1396 const auto& pgamma1 = gamma1.boundaryField()[patchi];
1397
1398 const label offset = mesh.nCells()+pvf.patch().offset();
1399
1400 if (pvf.coupled())
1401 {
1402 //auto tpnf(pvf.patchNeighbourField());
1403 //auto& pnf = tpnf();
1404 //auto tgamma0nf(pgamma0.patchNeighbourField());
1405 //auto& gamma0nf = tgamma0nf();
1406 //auto tgamma1nf(pgamma1.patchNeighbourField());
1407 //auto& gamma1nf = tgamma1nf();
1408
1409 for (label facei=0; facei<pFaceCells.size(); facei++)
1410 {
1411 const label ownCelli = pFaceCells[facei];
1412
1413 // Interpolate between owner-side and neighbour-side values
1414 const ResultType faceVal
1415 (
1416 cop
1417 (
1418 pSf[facei], // area vector
1419
1420 pweights[facei],
1421
1422 gamma0i[ownCelli],
1423 gamma0i[offset+facei], //gamma0nf[facei],
1424
1425 gamma1i[ownCelli],
1426 gamma1i[offset+facei], //gamma1nf[facei],
1427
1428 pdc[facei],
1429 vfi[ownCelli],
1430 vfi[offset+facei] //pnf[facei]
1431 )
1432 );
1433 sfi[ownCelli] += faceVal;
1434 }
1435 }
1436 else
1437 {
1438 //auto tpnf(pvf.snGrad());
1439 //auto& pnf = tpnf();
1440 for (label facei=0; facei<pFaceCells.size(); facei++)
1441 {
1442 const label ownCelli = pFaceCells[facei];
1443
1444 // Use patch value only
1445 const ResultType faceVal
1446 (
1447 cop
1448 (
1449 pSf[facei], // area vector
1450
1451 scalar(1.0),
1452
1453 pgamma0[facei],
1454 pTraits<GType0>::zero, // not used
1455
1456 pgamma1[facei],
1457 pTraits<GType1>::zero, // not used
1458
1459 scalar(1.0), // use 100% of pnf
1461 vfi[offset+facei] //pnf[facei]
1462 )
1463 );
1464 sfi[ownCelli] += faceVal;
1465 }
1466 }
1467 }
1468
1469 // Restore original size
1470 vf.constCast().resize(oldSize);
1471 gamma0.constCast().resize(oldSize);
1472 gamma1.constCast().resize(oldSize);
1473 }
1474
1476 {
1479}
1480
1481
1482template<class Type, class FType, class ResultType, class CellToFaceOp>
1483void interpolate
1484(
1485 const surfaceScalarField& weights,
1486 const GeometricField<Type, fvPatchField, volMesh>& vf,
1487 const GeometricField<FType, fvsPatchField, surfaceMesh>& sf,
1488 const CellToFaceOp& cop,
1489 GeometricField<ResultType, fvsPatchField, surfaceMesh>& result
1490)
1491{
1492 const fvMesh& mesh = vf.mesh();
1493 const auto& Sf = mesh.Sf();
1494 const auto& P = mesh.owner();
1495 const auto& N = mesh.neighbour();
1496
1497 const auto& vfi = vf.primitiveField();
1498
1499 // Internal field
1500 {
1501 const auto& Sfi = Sf.primitiveField();
1502 const auto& weight = weights.primitiveField();
1503 const auto& sfi = sf.primitiveField();
1504
1505 auto& resulti = result.primitiveFieldRef();
1506
1507 for (label facei=0; facei<P.size(); facei++)
1508 {
1509 const label ownCelli = P[facei];
1510 const label neiCelli = N[facei];
1511
1512 cop
1513 (
1514 Sfi[facei],
1515
1516 weight[facei],
1517 vfi[ownCelli],
1518 vfi[neiCelli],
1519
1520 sfi[facei],
1521
1522 resulti[facei]
1523 );
1524 }
1525 }
1526
1527
1528 // Boundary field
1529 {
1530 // Fetch patchNeighbourField onto end of GeoField
1531 const label oldSize = vf.constCast().boundaryEvaluate
1532 (
1533 [](const auto& pfld, UList<Type>& slice)
1534 {
1535 if (pfld.coupled())
1536 {
1537 pfld.patchNeighbourField(slice);
1538 }
1539 }
1540 );
1541
1542 forAll(mesh.boundary(), patchi)
1543 {
1544 const auto& pFaceCells = mesh.boundary()[patchi].faceCells();
1545 const auto& pSf = Sf.boundaryField()[patchi];
1546 const auto& pvf = vf.boundaryField()[patchi];
1547 const auto& pweight = weights.boundaryField()[patchi];
1548 const auto& psf = sf.boundaryField()[patchi];
1549 auto& presult = result.boundaryFieldRef()[patchi];
1550
1551 const label offset = mesh.nCells()+pvf.patch().offset();
1552
1553 if (pvf.coupled())
1554 {
1555 //auto tpnf(pvf.patchNeighbourField());
1556 //auto& pnf = tpnf();
1557
1558 for (label facei=0; facei<pFaceCells.size(); facei++)
1559 {
1560 // Interpolate between owner-side and neighbour-side values
1561 cop
1562 (
1563 pSf[facei],
1564
1565 pweight[facei],
1566 vfi[pFaceCells[facei]],
1567 vfi[offset+facei], //pnf[facei],
1568
1569 psf[facei],
1570
1571 presult[facei]
1572 );
1573 }
1574 }
1575 else
1576 {
1577 for (label facei=0; facei<pFaceCells.size(); facei++)
1578 {
1579 // Use patch value only
1580 cop
1581 (
1582 pSf[facei],
1583
1584 scalar(1.0),
1585 pvf[facei],
1586 pTraits<Type>::zero, // not used
1587
1588 psf[facei],
1589
1590 presult[facei]
1591 );
1592 }
1593 }
1594 }
1595
1596 // Restore original size
1597 vf.constCast().resize(oldSize);
1598 }
1599}
1600
1601
1602template
1603<
1604 class Type0,
1605 class Type1,
1606 class ResultType,
1607 class CellToFaceOp
1608>
1609void interpolate
1610(
1611 const surfaceScalarField& weights,
1614 const CellToFaceOp& cop,
1616)
1617{
1618 const fvMesh& mesh = vf0.mesh();
1619 const auto& Sf = mesh.Sf();
1620 const auto& P = mesh.owner();
1621 const auto& N = mesh.neighbour();
1622
1623 const auto& vf0i = vf0.primitiveField();
1624 const auto& vf1i = vf1.primitiveField();
1625
1626 // Internal field
1627 {
1628 const auto& Sfi = Sf.primitiveField();
1629 const auto& weight = weights.primitiveField();
1630
1631 auto& resulti = result.primitiveFieldRef();
1632
1633 for (label facei=0; facei<P.size(); facei++)
1634 {
1635 const label ownCelli = P[facei];
1636 const label neiCelli = N[facei];
1637
1638 cop
1639 (
1640 Sfi[facei],
1641
1642 weight[facei],
1643
1644 vf0i[ownCelli],
1645 vf0i[neiCelli],
1646
1647 vf1i[ownCelli],
1648 vf1i[neiCelli],
1649
1650 resulti[facei]
1651 );
1652 }
1653 }
1654
1655
1656 // Boundary field
1657 {
1658 // Fetch patchNeighbourField onto end of GeoField
1659 const label oldSize = vf0.constCast().boundaryEvaluate
1660 (
1661 [](const auto& pfld, UList<Type0>& slice)
1662 {
1663 if (pfld.coupled())
1664 {
1665 pfld.patchNeighbourField(slice);
1666 }
1667 }
1668 );
1669
1670 // Fetch patchNeighbourField onto end of GeoField
1671 (void) vf1.constCast().boundaryEvaluate
1672 (
1673 [](const auto& pfld, UList<Type1>& slice)
1674 {
1675 if (pfld.coupled())
1676 {
1677 pfld.patchNeighbourField(slice);
1678 }
1679 }
1680 );
1681
1682 forAll(mesh.boundary(), patchi)
1683 {
1684 const auto& pFaceCells = mesh.boundary()[patchi].faceCells();
1685 const auto& pSf = Sf.boundaryField()[patchi];
1686 const auto& pvf0 = vf0.boundaryField()[patchi];
1687 const auto& pvf1 = vf1.boundaryField()[patchi];
1688 const auto& pweight = weights.boundaryField()[patchi];
1689 auto& presult = result.boundaryFieldRef()[patchi];
1690
1691 const label offset = mesh.nCells()+pvf0.patch().offset();
1692
1693 if (pvf0.coupled() || pvf1.coupled())
1694 {
1695 //auto tpnf0(pvf0.patchNeighbourField());
1696 //auto& pnf0 = tpnf0();
1697 //auto tpnf1(pvf1.patchNeighbourField());
1698 //auto& pnf1 = tpnf1();
1699
1700 for (label facei=0; facei<pFaceCells.size(); facei++)
1701 {
1702 // Interpolate between owner-side and neighbour-side values
1703 cop
1704 (
1705 pSf[facei],
1706
1707 pweight[facei],
1708
1709 vf0i[pFaceCells[facei]],
1710 vf0i[offset+facei], //pnf0[facei],
1711
1712 vf1i[pFaceCells[facei]],
1713 vf1i[offset+facei], //pnf1[facei],
1714
1715 presult[facei]
1716 );
1717 }
1718 }
1719 else
1720 {
1721 for (label facei=0; facei<pFaceCells.size(); facei++)
1722 {
1723 // Use patch value only
1724 cop
1725 (
1726 pSf[facei],
1727
1728 scalar(1.0),
1729
1730 pvf0[facei],
1731 pTraits<Type0>::zero, // not used
1732
1733 pvf1[facei],
1734 pTraits<Type1>::zero, // not used
1735
1736 presult[facei]
1737 );
1738 }
1739 }
1740 }
1741
1742 // Restore original size
1743 vf0.constCast().resize(oldSize);
1744 vf1.constCast().resize(oldSize);
1745 }
1746}
1747
1748
1749// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1750
1751} // End namespace fvc
1752
1753// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
1754
1755} // End namespace Foam
1756
1757// ************************************************************************* //
const polyBoundaryMesh & pbm
const Mesh & mesh() const noexcept
Return const reference to mesh.
void resize(const label len)
Alter addressable list size, allocating new space if required while recovering old content.
Generic GeometricField class.
this_type & constCast() const noexcept
Return non-const reference to this field.
Internal::FieldType & primitiveFieldRef(const bool updateAccessTime=true)
Return a reference to the internal field values.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
const Internal::FieldType & primitiveField() const noexcept
Return a const-reference to the internal field values.
label boundaryEvaluate(const Cop &cop)
Evaluate boundary functions using the field storage:
void correctBoundaryConditions()
Correct boundary field.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
A non-owning sub-view of a List (allocated or unallocated storage).
Definition SubList.H:61
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
void size(const label n)
Older name for setAddressableSize.
Definition UList.H:118
label size() const noexcept
The number of entries in the list.
Definition UPtrListI.H:106
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition bitSet.H:61
void set(const bitSet &bitset)
Set specified bits from another bitset.
Definition bitSetI.H:502
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
A traits class, which is primarily used for primitives and vector-space.
Definition pTraits.H:64
const scalar gamma
Definition EEqn.H:9
dynamicFvMesh & mesh
Surface integrate surfaceField creating a volField. Surface sum a surfaceField creating a volField.
const cellShapeList & cells
Namespace of functions to calculate explicit derivatives.
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
void GaussOp(const surfaceScalarField &lambdas, const GeometricField< Type, fvPatchField, volMesh > &vf, const CombineOp &cop, GeometricField< ResultType, fvPatchField, volMesh > &result)
void surfaceOp(const GeometricField< Type, fvPatchField, volMesh > &vf, const surfaceVectorField &ownLs, const surfaceVectorField &neiLs, const CombineOp &cop, GeometricField< ResultType, fvPatchField, volMesh > &result)
tmp< GeometricField< Type, fvPatchField, volMesh > > surfaceSum(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
void surfaceSnSum(const surfaceScalarField &deltaCoeffs, const GeometricField< Type, fvPatchField, volMesh > &vf, const CellToFaceOp &cop, GeometricField< ResultType, fvPatchField, volMesh > &result, const bool doCorrectBoundaryConditions)
sum of snGrad
Namespace for OpenFOAM.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
static void doCorrectBoundaryConditions(bool correctBCs, VolumeField< Type > &field)
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
dimensionedScalar lambda("lambda", dimTime/sqr(dimLength), laminarTransport)
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299
const Vector< label > N(dict.get< Vector< label > >("N"))