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,
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,
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,
105  );
106 
107 
108  // Surface pressure
109  areaScalarField ps
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");
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:40
static tmp< GeometricField< Type, faePatchField, edgeMesh > > interpolate(const GeometricField< Type, faPatchField, areaMesh > &tvf, const edgeScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
const dimensionSet dimless
Dimensionless.
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
tmp< GeometricField< Type, faPatchField, areaMesh > > laplacian(const GeometricField< Type, faPatchField, areaMesh > &vf, const word &name)
Definition: facLaplacian.C:40
Us
GeometricField< scalar, faePatchField, edgeMesh > edgeScalarField
Definition: edgeFieldsFwd.H:46
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:26
edgeScalarField phis(IOobject("phis", runTime.timeName(), aMesh.thisDb(), IOobject::NO_READ, IOobject::NO_WRITE), linearEdgeInterpolate(Us) &aMesh.Le())
const uniformDimensionedVectorField & g
const dimensionedScalar h
Planck constant.
dimensionedScalar rhol("rhol", dimDensity, transportProperties)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:50
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Definition: dimensionSets.H:51
messageStream Info
Information stream (stdout output on master, null elsewhere)
GeometricField< vector, faPatchField, areaMesh > areaVectorField
Definition: areaFieldsFwd.H:81
GeometricField< scalar, faPatchField, areaMesh > areaScalarField
Definition: areaFieldsFwd.H:80
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127
const dimensionSet dimVelocity