IntegralScaleBox.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) 2022 OpenCFD Ltd.
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 "IntegralScaleBox.H"
29#include "cartesianCS.H"
30#include "OBJstream.H"
31
32// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33
34template<class Type>
35const Foam::Enum
36<
37 typename Foam::turbulence::IntegralScaleBox<Type>::kernelType
38>
40({
41 { kernelType::GAUSSIAN, "Gaussian" },
42 { kernelType::EXPONENTIAL , "exponential" }
43});
44
45
46template<class Type>
48
49
50// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
51
52template<class Type>
55(
56 const dictionary& dict
57) const
58{
59 if (dict.found(coordinateSystem::typeName_()))
60 {
61 return coordinateSystem::New
62 (
63 p_.patch().boundaryMesh().mesh(),
64 dict,
65 coordinateSystem::typeName_()
66 );
67 }
68
69 return nullptr;
70}
71
72
73template<class Type>
75{
76 // Get patch normal direction into the domain
77 const vector nf((-gAverage(p_.nf())).normalise());
78
79 // Find the second local coordinate direction
80 direction minCmpt = 0;
81 scalar minMag = mag(nf[minCmpt]);
82 for (direction cmpt = 1; cmpt < pTraits<vector>::nComponents; ++cmpt)
83 {
84 const scalar s = mag(nf[cmpt]);
85 if (s < minMag)
86 {
87 minMag = s;
88 minCmpt = cmpt;
89 }
90 }
91
92 // Create the second local coordinate direction
93 vector e2(Zero);
94 e2[minCmpt] = 1;
95
96 // Remove normal component
97 e2 -= (nf&e2)*nf;
98
99 // Create the local coordinate system - default e3-e1 order
100 csysPtr_.reset
101 (
102 new coordSystem::cartesian
103 (
104 Zero, // origin
105 nf^e2, // e3
106 nf // e1
107 )
108 );
109}
110
111
112template<class Type>
115{
116 // Convert patch points into local coordinate system
117 const pointField localPos
118 (
119 csysPtr_->localPosition
120 (
122 (
123 p_.patch().points(),
124 p_.patch().meshPoints()
125 )
126 )
127 );
128
129 // Calculate bounding-box span and min
130 const bool globalReduction = true;
131 const boundBox bb(localPos, globalReduction);
132
133 return Vector2D<vector>(bb.span(), bb.min());
134}
135
136
137template<class Type>
140{
141 return Vector2D<scalar>
142 (
143 boundingBoxSpan_[1]/n_.x(),
144 boundingBoxSpan_[2]/n_.y()
145 );
146}
147
148
149template<class Type>
151{
152 if (!Pstream::master())
153 {
154 return labelList();
155 }
156
157 labelList spans(pTraits<TypeL>::nComponents, label(1));
158 const Vector<label> slice(label(1), n_.x(), n_.y());
159 const TypeL L(convert(L_));
160
161 label j = 0;
162 if (fsm_)
163 {
164 j = pTraits<Type>::nComponents;
165 }
166
167 for (label i = j; i < pTraits<TypeL>::nComponents; ++i)
168 {
169 const label slicei = label(i/pTraits<Type>::nComponents);
170
171 const label n = ceil(L[i]);
172 const label twiceN = 4*n;
173
174 spans[i] = slice[slicei] + twiceN;
175 }
176
177 return spans;
178}
179
180
181template<class Type>
184{
185 if (!Pstream::master())
186 {
187 return scalarListList();
188 }
189
190 scalarListList kernel
191 (
192 pTraits<TypeL>::nComponents,
193 scalarList(1, scalar(1))
194 );
195
196 const TypeL L(convert(L_));
197
198 label i = 0;
199 if (fsm_)
200 {
201 i = pTraits<Type>::nComponents;
202 }
203
204 for (direction dir = i; dir < pTraits<TypeL>::nComponents; ++dir)
205 {
206 // The smallest kernel width larger than integral scale
207 // (KSJ:'n' in Eq. 15)
208 const label n = ceil(L[dir]);
209
210 // Full kernel-width (except mid-zero) according to the condition
211 // (KSJ:Eq. 15 whereat N is minimum = 2n)
212 const label twiceN = 4*n;
213
214 // Initialise kernel-coeffs containers with full kernel-width size
215 // Extra elem is mid-zero within [-N, N]
216 kernel[dir] = scalarList(twiceN + 1, Zero);
217
218 // First element: -N within [-N, N]
219 const scalar initElem = -2*scalar(n);
220
221 // Container initialised with [-N, N] (KSJ:p. 658, item-b)
222 std::iota
223 (
224 kernel[dir].begin(),
225 kernel[dir].end(),
226 initElem
227 );
228
229 // Compute kernel coefficients (KSJ:Eq. 14 (Gaussian))
230 scalarList kTemp(kernel[dir]);
231 scalar kSum = 0;
232
233 // Model constant shaping the autocorrelation function (KSJ:Eq. 14)
234 const scalar C = -0.5*constant::mathematical::pi;
235
236 if (kernelType_)
237 {
238 const scalar nSqr = n*n;
239
240 kTemp = sqr(Foam::exp(C*sqr(kTemp)/nSqr));
241 kSum = Foam::sqrt(sum(kTemp));
242
243 kernel[dir] = Foam::exp(C*sqr(kernel[dir])/nSqr)/kSum;
244 }
245 else
246 {
247 kTemp = sqr(Foam::exp(C*mag(kTemp)/n));
248 kSum = Foam::sqrt(sum(kTemp));
249
250 kernel[dir] = Foam::exp(C*mag(kernel[dir])/n)/kSum;
251 }
252 }
253
254 return kernel;
255}
256
257
258template<class Type>
260{
261 if (!Pstream::master())
262 {
263 return scalarListList();
264 }
265
266 scalarListList box(pTraits<Type>::nComponents, scalarList());
267
268 // Initialise: Remaining convenience factors for (e1 e2 e3)
269 for (direction dir = 0; dir < pTraits<Type>::nComponents; ++dir)
270 {
271 scalarList& randomSet = box[dir];
272
273 randomSet = scalarList
274 (
275 spans_[dir]
276 *spans_[dir+pTraits<TypeL>::nComponents/3]
277 *spans_[dir+2*(pTraits<TypeL>::nComponents/3)]
278 );
279
280 if (randomSet.size() > 1e8)
281 {
283 << "Size of random-number set is relatively high:" << nl
284 << " size = " << randomSet.size() << nl
285 << " Please consider to use the forward-stepwise method."
286 << endl;
287 }
288
289 // Initialise: Integral-scale box content with random-number
290 // sets obeying the standard normal distribution
291 std::generate
292 (
293 randomSet.begin(),
294 randomSet.end(),
295 [&]{ return rndGen_.GaussNormal<scalar>(); }
296 );
297 }
298
299 return box;
300}
301
302
303template<class Type>
306{
307 if (!Pstream::master())
308 {
309 return pointField();
310 }
311
312 // List of vertex points of the virtual patch in local coordinate system
313 const label nx = n_.x();
314 const label ny = n_.y();
315 const label nPoints = (nx + 1)*(ny + 1);
317
318 label pointi = 0;
319 for (label j = 0; j <= ny; ++j)
320 {
321 for (label i = 0; i <= nx; ++i)
322 {
323 const point p
324 (
325 boundingBoxMin_[0],
326 boundingBoxMin_[1] + i*delta_.x(),
327 boundingBoxMin_[2] + j*delta_.y()
328 );
329 points[pointi] = p;
330 ++pointi;
331 }
332 }
333
334 points = csysPtr_->globalPosition(points);
335
336 return points;
337}
338
339
340template<class Type>
342{
343 if (!Pstream::master())
344 {
345 return faceList();
346 }
347
348 // List of faces of the virtual patch
349 const label nx = n_.x();
350 const label ny = n_.y();
351 const label nFaces = nx*ny;
352 faceList faces(nFaces);
353
354 label m = 0;
355 for (label j = 0; j < ny; ++j)
356 {
357 for (label i = 0; i < nx; ++i)
358 {
359 const label k = j*(nx+1) + i;
360 faces[m] = face({k, k+(nx+1), k+(nx+2), k+1});
361 ++m;
362 }
363 }
364
365 return faces;
366}
367
368
369template<class Type>
371{
372 if (debug && Pstream::master())
373 {
374 const auto& tm = p_.patch().boundaryMesh().mesh().time();
375 OBJstream os(tm.path()/"patch.obj");
376 os.write(patchFaces_, patchPoints_, false);
377 }
378
379 if (!patchPtr_)
380 {
381 patchPtr_.reset
382 (
383 new primitivePatch
384 (
385 SubList<face>(patchFaces_, patchFaces_.size()),
386 patchPoints_
387 )
388 );
389 }
390}
391
392
393template<class Type>
394typename Foam::turbulence::IntegralScaleBox<Type>::TypeL
396(
397 const typename Foam::turbulence::IntegralScaleBox<Type>::TypeL& L
398) const
399{
400 TypeL Ls(L);
401
402 const scalar deltaT =
403 p_.patch().boundaryMesh().mesh().time().deltaTValue();
404
405 for (direction dir = 0; dir < pTraits<Type>::nComponents; ++dir)
406 {
407 // (KSJ:Eq. 13)
408 // Integral time scales
409 Ls[dir] /= deltaT;
410 // Integral length scales
411 Ls[dir + Ls.size()/3] /= delta_.x();
412 Ls[dir + 2*(Ls.size()/3)] /= delta_.y();
413 }
414
415 return Ls;
416}
417
418
419template<class Type>
421(
422 const vector& L
423) const
424{
425 constexpr scalar c1 = -0.25*constant::mathematical::pi;
426 return Foam::exp(c1/L.x());
427}
428
429
430template<class Type>
432(
433 const tensor& L
434) const
435{
436 constexpr scalar c1 = -0.25*constant::mathematical::pi;
437
438 vector C1(Zero);
439 forAll(C1, i)
440 {
441 C1[i] = Foam::exp(c1/L.x()[i]);
442 }
443
444 return C1;
445}
446
447
448template<class Type>
450(
451 const vector& L
452) const
453{
454 constexpr scalar c2 = -0.5*constant::mathematical::pi;
455 return Foam::sqrt(scalar(1) - Foam::exp(c2/L.x()));
456}
457
458
459template<class Type>
461(
462 const tensor& L
463) const
464{
465 constexpr scalar c2 = -0.5*constant::mathematical::pi;
466
467 vector C2(Zero);
468 forAll(C2, i)
469 {
470 C2[i] = Foam::sqrt(scalar(1) - Foam::exp(c2/L.x()[i]));
471 }
472
473 return C2;
474}
475
476
477template<class Type>
479{
480 if (p_.patch().boundaryMesh().mesh().time().isAdjustTimeStep())
481 {
482 C1_ = calcC1(convert(L_));
483 C2_ = calcC2(convert(L_));
484 }
485}
486
487
488// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
489
490template<class Type>
492(
493 const fvPatch& p
494)
495:
496 p_(p),
497 patchPtr_(nullptr),
498 csysPtr_(nullptr),
499 kernelType_(kernelType::GAUSSIAN),
500 rndGen_(0),
501 n_(Zero),
502 delta_(Zero),
503 boundingBoxSpan_(Zero),
504 boundingBoxMin_(Zero),
505 L_(Zero),
506 spans_(Zero),
507 box_(Zero),
508 kernel_(Zero),
509 patchPoints_(Zero),
510 patchFaces_(Zero),
511 fsm_(false),
512 C1_(Zero),
513 C2_(Zero),
514 slice_(Zero)
515{}
516
517
518template<class Type>
520(
521 const fvPatch& p,
522 const IntegralScaleBox& b
523)
524:
525 p_(p),
526 patchPtr_(nullptr),
527 csysPtr_(b.csysPtr_.clone()),
528 kernelType_(b.kernelType_),
529 rndGen_(b.rndGen_),
530 n_(b.n_),
531 delta_(b.delta_),
532 boundingBoxSpan_(b.boundingBoxSpan_),
533 boundingBoxMin_(b.boundingBoxMin_),
534 L_(b.L_),
535 spans_(b.spans_),
536 box_(b.box_),
537 kernel_(b.kernel_),
538 patchPoints_(b.patchPoints_),
539 patchFaces_(b.patchFaces_),
540 fsm_(b.fsm_),
541 C1_(b.C1_),
542 C2_(b.C2_),
543 slice_(b.slice_)
544{}
545
546
547template<class Type>
549(
550 const fvPatch& p,
551 const dictionary& dict
552)
553:
554 p_(p),
555 patchPtr_(nullptr),
556 csysPtr_(calcCoordinateSystem(dict)),
557 kernelType_
558 (
559 kernelTypeNames.getOrDefault
560 (
561 "kernelType",
562 dict,
563 kernelType::GAUSSIAN
564 )
565 ),
566 rndGen_(time(0)),
567 n_(dict.get<Vector2D<label>>("n")),
568 delta_(Zero),
569 boundingBoxSpan_(Zero),
570 boundingBoxMin_(Zero),
571 L_(dict.get<TypeL>("L")),
572 spans_(Zero),
573 box_(Zero),
574 kernel_(Zero),
575 patchPoints_(Zero),
576 patchFaces_(Zero),
577 fsm_(dict.getOrDefault("fsm", false)),
578 C1_(Zero),
579 C2_(Zero),
580 slice_(Zero)
581{
582 if (cmptMin(L_) < ROOTVSMALL)
583 {
585 << "Integral scale set contains a very small input" << nl
586 << " L = " << L_
587 << exit(FatalIOError);
588 }
589
590 if (min(n_.x(), n_.y()) <= 0)
591 {
593 << "Number of faces on box inlet plane has non-positive input"
594 << " n = " << n_
595 << exit(FatalIOError);
596 }
597}
598
599
600template<class Type>
602(
603 const IntegralScaleBox& b
604)
605:
606 p_(b.p_),
607 patchPtr_(nullptr),
608 csysPtr_(b.csysPtr_.clone()),
609 kernelType_(b.kernelType_),
610 rndGen_(b.rndGen_),
611 n_(b.n_),
612 delta_(b.delta_),
613 boundingBoxSpan_(b.boundingBoxSpan_),
614 boundingBoxMin_(b.boundingBoxMin_),
615 L_(b.L_),
616 spans_(b.spans_),
617 box_(b.box_),
618 kernel_(b.kernel_),
619 patchPoints_(b.patchPoints_),
620 patchFaces_(b.patchFaces_),
621 fsm_(b.fsm_),
622 C1_(b.C1_),
623 C2_(b.C2_),
624 slice_(b.slice_)
625{}
626
627
628// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
629
630template<class Type>
632{
633 if (!csysPtr_)
634 {
635 calcCoordinateSystem();
636 }
637
638 if (debug && csysPtr_)
639 {
640 Info<< "Local coordinate system:" << nl
641 << " - origin = " << csysPtr_->origin() << nl
642 << " - e1-axis = " << csysPtr_->e1() << nl
643 << " - e2-axis = " << csysPtr_->e2() << nl
644 << " - e3-axis = " << csysPtr_->e3() << nl << endl;
645 }
646
647 {
648 const Vector2D<vector> bb(calcBoundBox());
649
650 boundingBoxSpan_ = bb.x();
651
652 boundingBoxMin_ = bb.y();
653 }
654
655 delta_ = calcDelta();
656
657 spans_ = calcSpans();
658
659 kernel_ = calcKernel();
660
661 box_ = calcBox();
662
663 patchPoints_ = calcPatchPoints();
664
665 patchFaces_ = calcPatchFaces();
666
667 calcPatch();
668
669 if (fsm_)
670 {
671 C1_ = calcC1(convert(L_));
672
673 C2_ = calcC2(convert(L_));
674
675 slice_ = Field<Type>(p_.size(), Zero);
676 }
677}
678
679
680template<class Type>
682{
683 for (direction dir = 0; dir < pTraits<Type>::nComponents; ++dir)
684 {
685 scalarList& slice = box_[dir];
686
687 // Slice span: span of each inlet-normal slice of integral-scale box
688 // e.g. for U: (Lyu*Lzu, Lyv*Lzv, Lyw*Lzw)
689 const label sliceSpan =
690 spans_[dir + pTraits<TypeL>::nComponents/3]
691 *spans_[dir + 2*(pTraits<TypeL>::nComponents/3)];
692
693 // Shift forward from the back to the front
694 inplaceRotateList(slice, sliceSpan);
695 }
696}
697
698
699template<class Type>
701{
702 for (direction dir = 0; dir < pTraits<Type>::nComponents; ++dir)
703 {
704 scalarList& slice = box_[dir];
705
706 const label sliceSpan =
707 spans_[dir + pTraits<TypeL>::nComponents/3]
708 *spans_[dir + 2*(pTraits<TypeL>::nComponents/3)];
709
710 // Refill the back with a new random-number set
711 for (label i = 0; i < sliceSpan; ++i)
712 {
713 slice[i] = rndGen_.GaussNormal<scalar>();
714 }
715 }
716}
717
718
719template<class Type>
722{
723 Field<Type> outFld(n_.x()*n_.y(), Zero);
724
725 for (direction dir = 0; dir < pTraits<Type>::nComponents; ++dir)
726 {
727 const scalarList& in = box_[dir];
728
729 Field<scalar> out(n_.x()*n_.y(), Zero);
730
731 const scalarList& kernel1 = kernel_[dir];
732 const scalarList& kernel2 =
733 kernel_[dir + pTraits<TypeL>::nComponents/3];
734 const scalarList& kernel3 =
735 kernel_[dir + 2*(pTraits<TypeL>::nComponents/3)];
736
737 const label szkernel1 = kernel1.size();
738 const label szkernel2 = kernel2.size();
739 const label szkernel3 = kernel3.size();
740
741 const label sz1 = spans_[dir];
742 const label sz2 = spans_[dir + pTraits<TypeL>::nComponents/3];
743 const label sz3 = spans_[dir + 2*(pTraits<TypeL>::nComponents/3)];
744 const label sz23 = sz2*sz3;
745 const label sz123 = sz1*sz23;
746
747 const label validSlice2 = sz2 - (szkernel2 - 1);
748 const label validSlice3 = sz3 - (szkernel3 - 1);
749
750 // Convolution summation - Along 1st direction
751 scalarField tmp(sz123, Zero);
752 {
753 const label filterCentre = label(szkernel2/label(2));
754 const label endIndex = sz2 - filterCentre;
755 label i0 = 0;
756 label i1 = 0;
757
758 for (label i = 0; i < sz1; ++i)
759 {
760 for (label j = 0; j < sz3; ++j)
761 {
762 i1 += filterCentre;
763
764 for (label k = filterCentre; k < endIndex; ++k)
765 {
766 label q = 0;
767
768 for (label p = szkernel2 - 1; p >= 0; --p, ++q)
769 {
770 tmp[i1] += in[i0 + q]*kernel2[p];
771 }
772 ++i0;
773 ++i1;
774 }
775 i0 += 2*filterCentre;
776 i1 += filterCentre;
777 }
778 }
779 }
780
781 // Convolution summation - Along 2nd direction
782 {
783 const scalarField tmp2(tmp);
784 const label filterCentre = label(szkernel3/label(2));
785 const label endIndex = sz3 - filterCentre;
786 label i1 = 0;
787 label i2 = 0;
788
789 for (label i = 0; i < sz1; ++i)
790 {
791 const label sl = i*sz23;
792
793 for (label j = 0; j < sz2; ++j)
794 {
795 i1 = j + sl;
796 i2 = i1;
797
798 for (label k = 0; k < endIndex - filterCentre; ++k)
799 {
800 tmp[i1] = 0;
801
802 for (label p = szkernel3 - 1, q = 0; p >= 0; --p, ++q)
803 {
804 tmp[i1] += tmp2[i2 + q*sz2]*kernel3[p];
805 }
806 i1 += sz2;
807 i2 += sz2;
808 }
809 i1 += (sz2 + filterCentre);
810 i2 += (sz2 + filterCentre);
811 }
812 }
813 }
814
815 // Convolution summation - Along 3rd direction
816 {
817 label i1 = (szkernel2 - label(1))/label(2);
818 label i2 = (szkernel2 - label(1))/label(2);
819 label i3 = 0;
820
821 for (label i = 0; i < validSlice3; ++i)
822 {
823 for (label j = 0; j < validSlice2; ++j)
824 {
825 scalar sum = 0;
826 i1 = i2 + j;
827
828 for (label k = szkernel1 - 1; k >= 0; --k)
829 {
830 sum += tmp[i1]*kernel1[k];
831 i1 += sz23;
832 }
833 out[i3] = sum;
834 ++i3;
835 }
836 i2 += sz2;
837 }
838 }
839
840 outFld.replace(dir, out);
841 }
842
843 return outFld;
844}
845
846
847template<class Type>
849(
851)
852{
853 updateC1C2();
854
855 fld *= C2_;
856 fld += slice_*C1_;
857
858 // Store current field for the next time-step
859 slice_ = fld;
860}
861
862
863template<class Type>
865(
867)
868{
869 updateC1C2();
870
871 for (direction dir = 0; dir < pTraits<vector>::nComponents; ++dir)
872 {
873 fld.replace
874 (
875 dir,
876 slice_.component(dir)*C1_[dir] + fld.component(dir)*C2_[dir]
877 );
878 }
879
880 // Store current field for the next time-step
881 slice_ = fld;
882}
883
884
885template<class Type>
887(
888 Ostream& os
889) const
890{
891 os.writeEntryIfDifferent<bool>("fsm", false, fsm_);
892 os.writeEntry("n", n_);
893 os.writeEntry("L", L_);
894 os.writeEntry("kernelType", kernelTypeNames[kernelType_]);
895 if (csysPtr_)
896 {
897 csysPtr_->writeEntry(os);
898 }
899}
900
901
902// ************************************************************************* //
static const Foam::dimensionedScalar C("", Foam::dimTemperature, 234.5)
label k
label n
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
void replace(const direction, const UList< cmptType > &)
Replace a component field of the field.
Definition: Field.C:557
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
Templated 2D Vector derived from VectorSpace adding construction from 2 components,...
Definition: Vector2D.H:58
const Cmpt & y() const
Access to the vector y component.
Definition: Vector2DI.H:73
const Cmpt & x() const
Access to the vector x component.
Definition: Vector2DI.H:66
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
virtual bool write()
Write the output fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
A traits class, which is primarily used for primitives.
Definition: pTraits.H:59
Tensor of scalars, i.e. Tensor<scalar>.
A class for managing temporary objects.
Definition: tmp.H:65
Class to describe the integral-scale container being used in the turbulentDigitalFilterInletFvPatchFi...
void initialise()
Initialise integral-scale box properties.
void refill()
Add a new integral-scale box slice to the rear of the box.
const primitivePatch & patch()
Return const reference to integral-scale box inlet patch.
void correlate(scalarField &fld)
Apply forward-stepwise correlation for scalar fields.
Field< Type > convolve() const
Embed two-point correlations, i.e. L.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
volScalarField & p
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:473
OBJstream os(runTime.globalPath()/outputName)
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
const pointField & points
label nPoints
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
#define WarningInFunction
Report a warning using Foam::Warning.
const dimensionedScalar c2
Second radiation constant: default SI units: [m.K].
const dimensionedScalar c1
First radiation constant: default SI units: [W/m2].
dimensionedScalar exp(const dimensionedScalar &ds)
List< label > labelList
A List of labels.
Definition: List.H:66
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
messageStream Info
Information stream (stdout output on master, null elsewhere)
void inplaceRotateList(ListType< DataType > &list, label n)
Inplace reversal of a list using the Reversal Block Swapping algorithm.
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:44
List< scalar > scalarList
A List of scalars.
Definition: scalarList.H:64
vector point
Point is a vector.
Definition: point.H:43
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
uint8_t direction
Definition: direction.H:56
IOerror FatalIOError
Type gAverage(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
List< face > faceList
A List of faces.
Definition: faceListFwd.H:47
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
List< scalarList > scalarListList
A List of scalarList.
Definition: scalarList.H:66
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
Definition: stdFoam.H:158
constexpr auto begin(C &c) -> decltype(c.begin())
Return iterator to the beginning of the container c.
Definition: stdFoam.H:134
dictionary dict
volScalarField & b
Definition: createFields.H:27
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333
const vector L(dict.get< vector >("L"))