Loading...
Searching...
No Matches
createFaFields.H
Go to the documentation of this file.
1 Info<< "Reading field h" << endl;
3 (
4 IOobject
5 (
6 "h",
7 runTime.timeName(),
8 aMesh.thisDb(),
9 IOobject::MUST_READ,
10 IOobject::AUTO_WRITE
11 ),
12 aMesh
13 );
14
15
16 Info<< "Reading field Us" << endl;
18 (
19 IOobject
20 (
21 "Us",
22 runTime.timeName(),
23 aMesh.thisDb(),
24 IOobject::MUST_READ,
25 IOobject::AUTO_WRITE
26 ),
27 aMesh
28 );
29
30
32 (
33 IOobject
34 (
35 "phis",
36 runTime.timeName(),
37 aMesh.thisDb(),
38 IOobject::READ_IF_PRESENT,
39 IOobject::AUTO_WRITE
40 ),
41 fac::interpolate(Us) & aMesh.Le()
42 );
43
44
45 edgeScalarField phi2s
46 (
47 IOobject
48 (
49 "phi2s",
50 runTime.timeName(),
51 aMesh.thisDb(),
52 IOobject::READ_IF_PRESENT,
53 IOobject::AUTO_WRITE
54 ),
55 fac::interpolate(h*Us) & aMesh.Le()
56 );
57
58
59 const areaVectorField& Ns = aMesh.faceAreaNormals();
60 areaVectorField Gs(g - Ns*(Ns & g));
61 areaScalarField Gn(mag(g - Gs));
62
63 // Mass source
65 (
66 IOobject
67 (
68 "Sm",
69 runTime.timeName(),
70 aMesh.thisDb(),
71 IOobject::NO_READ,
72 IOobject::NO_WRITE
73 ),
74 aMesh,
75 dimensionedScalar(dimLength/dimTime, Zero)
76 );
77
78 // Mass sink
80 (
81 IOobject
82 (
83 "Sd",
84 runTime.timeName(),
85 aMesh.thisDb(),
86 IOobject::NO_READ,
87 IOobject::NO_WRITE
88 ),
89 aMesh,
90 dimensionedScalar(dimLength/dimTime, Zero)
91 );
92
94 (
95 IOobject
96 (
97 "Sg",
98 runTime.timeName(),
99 aMesh.thisDb(),
100 IOobject::NO_READ,
101 IOobject::NO_WRITE
102 ),
103 aMesh,
104 dimensionedVector(dimVelocity, Zero)
105 );
106
107
108 // Surface pressure
110 (
111 IOobject
112 (
113 "ps",
114 runTime.timeName(),
115 aMesh.thisDb(),
116 IOobject::NO_READ,
117 IOobject::AUTO_WRITE
118 ),
119 rhol*Gn*h - sigma*fac::laplacian(h)
120 );
121
122 // Friction factor
123 areaScalarField dotProduct
124 (
125 aMesh.faceAreaNormals() & (g/mag(g))
126 );
127
128 Info<< "View factor: min = " << min(dotProduct.internalField())
129 << " max = " << max(dotProduct.internalField()) << endl;
130
131 areaScalarField manningField
132 (
133 IOobject
134 (
135 "manningField",
136 runTime.timeName(),
137 aMesh.thisDb(),
138 IOobject::MUST_READ,
139 IOobject::AUTO_WRITE
140 ),
141 aMesh
142 );
143
144 areaScalarField frictionFactor
145 (
146 IOobject
147 (
148 "frictionFactor",
149 runTime.timeName(),
150 aMesh.thisDb(),
151 IOobject::NO_READ,
152 IOobject::NO_WRITE
153 ),
154 aMesh,
155 dimensionedScalar("one", dimless, 0.01)
156 );
157
158 aMesh.setFluxRequired("h");
const uniformDimensionedVectorField & g
engineTime & runTime
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition hashSets.C:40
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
GeometricField< vector, faPatchField, areaMesh > areaVectorField
GeometricField< scalar, faePatchField, edgeMesh > edgeScalarField
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:26
GeometricField< scalar, faPatchField, areaMesh > areaScalarField
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
volScalarField & h
dimensionedScalar rhol("rhol", dimDensity, transportProperties)
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
edgeScalarField phis(IOobject("phis", runTime.timeName(), aMesh.thisDb(), IOobject::NO_READ, IOobject::NO_WRITE), linearEdgeInterpolate(Us) &aMesh.Le())