Skip to content

Commit b326fa1

Browse files
committed
Some updates to ABLTerrainSolver.
1 parent 1c679a6 commit b326fa1

File tree

14 files changed

+135
-415
lines changed

14 files changed

+135
-415
lines changed

applications/solvers/incompressible/windEnergy/ABLSolver/pEqn.H

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@
4949
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
5050
);
5151

52-
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
52+
if (activatePressureRefCell)
53+
{
54+
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
55+
}
5356

5457
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
5558

applications/solvers/incompressible/windEnergy/ABLSolver/readABLProperties.H

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,29 @@
222222
Info << "Defining background hydrostatic pressure to be " << perturbationOutput << endl;
223223

224224

225+
// This switch dictates whether or not the pressure reference cell is set explicitly
226+
// in the p_rgh solve. If true, pressure is constrained at the pressure reference
227+
// cell by manipulating the matrix row for that cell to remove the null space. This
228+
// assures that the pressure level is constrained, but it also means the continuity
229+
// equation is no longer solved at that cell, so the divergence error can be significant
230+
// enough there to cause localized oscillations. Iterative solvers can still converge
231+
// even with a null space, but more iterations may be needed, so this switch can be
232+
// set to false.
233+
bool activatePressureRefCell(ABLProperties.lookupOrDefault<bool>("activatePressureRefCell", true));
234+
if (activatePressureRefCell)
235+
{
236+
Info << "Pressure reference cell matrix row modification enabled" << endl;
237+
}
238+
else
239+
{
240+
Info << "Pressure reference cell matrix row modification not enabled" << endl;
241+
}
242+
243+
244+
245+
246+
247+
225248

226249

227250
// PROPERTIES CONCERNING GATHERING STATISTICS

applications/solvers/incompressible/windEnergy/ABLTerrainSolver/ABLTerrainSolver.C

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,9 @@ int main(int argc, char *argv[])
9393
// field.
9494
U.correctBoundaryConditions();
9595
phi = linearInterpolate(U) & mesh.Sf();
96+
#include "turbulenceCorrect.H"
9697
T.correctBoundaryConditions();
9798
//p_rgh.correctBoundaryConditions();
98-
turbulence->correct();
99-
Rwall.correctBoundaryConditions();
100-
qwall.correctBoundaryConditions();
101-
10299

103100
while (runTime.loop())
104101
{
@@ -113,14 +110,20 @@ int main(int argc, char *argv[])
113110
// --- Pressure-velocity PIMPLE corrector loop
114111
while (pimple.loop())
115112
{
113+
Info << " Predictor..." << endl;
116114
#include "UEqn.H"
115+
#include "turbulenceCorrect.H"
117116
#include "TEqn.H"
118117

119118
// --- Pressure corrector loop
119+
int corr = 0;
120120
while (pimple.correct())
121121
{
122+
Info << " Corrector Step " << corr << "..." << endl;
122123
#include "pEqn.H"
124+
#include "turbulenceCorrect.H"
123125
#include "TEqn.H"
126+
corr++;
124127
}
125128

126129
// --- Compute the velocity flux divergence
@@ -130,15 +133,15 @@ int main(int argc, char *argv[])
130133
#include "correctGradP.H"
131134

132135
// --- Update the turbulence fields
133-
if (pimple.turbCorr())
134-
{
135-
turbulence->correct();
136-
}
136+
// if (pimple.turbCorr())
137+
// {
138+
// turbulence->correct();
139+
// }
137140

138141
// --- Update the boundary momentum and
139142
// temperature flux conditions
140-
Rwall.correctBoundaryConditions();
141-
qwall.correctBoundaryConditions();
143+
// Rwall.correctBoundaryConditions();
144+
// qwall.correctBoundaryConditions();
142145
}
143146

144147

applications/solvers/incompressible/windEnergy/ABLTerrainSolver/Make/options

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ EXE_INC = \
55
-I$(LIB_SRC)/finiteVolume/lnInclude \
66
-I$(LIB_SRC)/meshTools/lnInclude \
77
-I$(LIB_SRC)/fvOptions/lnInclude \
8-
-I$(LIB_SRC)/sampling/lnInclude
8+
-I$(LIB_SRC)/sampling/lnInclude \
9+
-I../commonAlgorithms \
10+
-I../commonAlgorithms/interpolate2D \
11+
-I../commonAlgorithms/windRoseToCartesian
912

1013

1114
EXE_LIBS = \

applications/solvers/incompressible/windEnergy/ABLTerrainSolver/UEqn.H

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include "computeCoriolisForce.H"
44

5+
#include "computeBuoyancyTerm.H"
6+
57
fvVectorMatrix UEqn
68
(
79
fvm::ddt(U) // time derivative
@@ -24,7 +26,7 @@
2426
(
2527
(
2628
- fvc::snGrad(p_rgh) // modified pressure gradient
27-
- ghf*fvc::snGrad(rhok) // buoyancy force
29+
+ buoyancyTerm // buoyancy force
2830
) * mesh.magSf()
2931
)
3032
);

applications/solvers/incompressible/windEnergy/ABLTerrainSolver/computeCoriolisForce.H

Lines changed: 0 additions & 23 deletions
This file was deleted.

applications/solvers/incompressible/windEnergy/ABLTerrainSolver/computeDivergence.H

Lines changed: 0 additions & 34 deletions
This file was deleted.

applications/solvers/incompressible/windEnergy/ABLTerrainSolver/createDivSchemeBlendingField.H

Lines changed: 0 additions & 164 deletions
This file was deleted.

0 commit comments

Comments
 (0)