Skip to content

Commit 25e0203

Browse files
author
Nijat Nazim Rustamov
committed
fix docs and styles
1 parent 3b3f004 commit 25e0203

File tree

4 files changed

+42
-44
lines changed

4 files changed

+42
-44
lines changed
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
1-
# LBMFixedFirstOrderBC9Q
1+
# LBMFixedFirstOrderBC
22

3-
!syntax description /TensorComputes/Solve/LBMFixedFirstOrderBC9Q
3+
!syntax description /TensorComputes/Solve/LBMFixedFirstOrderBC
44

5-
LBMFixedFirstOrderBC implements Zou\-He velocity boundary conditions at the inlet and outlet for D2Q9, D3Q19 and D3Q27 stencils. The choice of stencil should be indicated in the name of the compute object such as LBMFixedFirstOrderBC9Q for D2Q9.
5+
LBMFixedFirstOrderBC implements Zou\-He velocity boundary conditions at the inlet and outlet for D2Q9, D3Q19 and D3Q27 stencils.
66

77
## Overview
88

99
Enforces first\-order accurate macroscopic velocity at selected domain faces via Zou\-He formulas.
10-
Choose faces with [!param](/TensorComputes/Solve/LBMFixedFirstOrderBC9Q/boundary) and provide
10+
Choose faces with [!param](/TensorComputes/Solve/LBMFixedFirstOrderBC/boundary) and provide
1111
macroscopic fields as required by the implementation.
1212

1313
## Example Input File Syntax
1414

1515
!listing test/tests/lbm/vertical_velocity_bcs.i block=TensorComputes/Boundary/top
1616
!listing test/tests/lbm/vertical_velocity_bcs.i block=TensorComputes/Boundary/bottom
1717

18-
!syntax parameters /TensorComputes/Solve/LBMFixedFirstOrderBC9Q
19-
20-
!syntax inputs /TensorComputes/Solve/LBMFixedFirstOrderBC9Q
21-
22-
!syntax children /TensorComputes/Solve/LBMFixedFirstOrderBC9Q
18+
!syntax parameters /TensorComputes/Solve/LBMFixedFirstOrderBC
Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
1-
# LBMFixedZerothOrderBC9Q
1+
# LBMFixedZerothOrderBC
22

3-
!syntax description /TensorComputes/Solve/LBMFixedZerothOrderBC9Q
3+
!syntax description /TensorComputes/Solve/LBMFixedZerothOrderBC
44

5-
LBMFixedZerothOrderBC implements Zou-He pressure boundary conditions at the inlet and outlet for D2Q9, D3Q19 and D3Q27 stencils. The choice of stencil should be indicated in the name of the compute object such as LBMFixedZerothOrderBC9Q for D2Q9.
5+
LBMFixedZerothOrderBC implements Zou-He pressure boundary conditions at the inlet and outlet for D2Q9, D3Q19 and D3Q27 stencils.
66

77
## Overview
88

9-
LBMFixedZerothOrderBC implements Zou\-He pressure boundary conditions at the inlet and outlet for D2Q9, D3Q19 and D3Q27 stencils. The choice of stencil should be indicated in the name of the compute object such as LBMFixedZerothOrderBC9Q for D2Q9.
10-
Choose faces with [!param](/TensorComputes/Solve/LBMFixedZerothOrderBC9Q/boundary) and provide macroscopic fields as
9+
LBMFixedZerothOrderBC implements Zou\-He pressure boundary conditions at the inlet and outlet for D2Q9, D3Q19 and D3Q27 stencils.
10+
Choose faces with [!param](/TensorComputes/Solve/LBMFixedZerothOrderBC/boundary) and provide macroscopic fields as
1111
required by the implementation.
1212

1313
## Example Input File Syntax
1414

1515
!listing test/tests/lbm/vertical_density_bcs.i block=TensorComputes/Boundary/top
1616
!listing test/tests/lbm/vertical_density_bcs.i block=TensorComputes/Boundary/bottom
1717

18-
!syntax parameters /TensorComputes/Solve/LBMFixedZerothOrderBC9Q
19-
20-
!syntax inputs /TensorComputes/Solve/LBMFixedZerothOrderBC9Q
21-
22-
!syntax children /TensorComputes/Solve/LBMFixedZerothOrderBC9Q
18+
!syntax parameters /TensorComputes/Solve/LBMFixedZerothOrderBC

src/tensor_computes/LBMFixedFirstOrderBC.C

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ LBMFixedFirstOrderBC::frontBoundary()
4242
if (_domain.getDim() == 2)
4343
mooseError("There is no front boundary in 2 dimensions.");
4444
else
45-
mooseError("Front boundary is not implemented, but it can be replaced by any other boundary by rotating the domain.");
45+
mooseError("Front boundary is not implemented, but it can be replaced by any other boundary by "
46+
"rotating the domain.");
4647
}
4748

4849
void
@@ -51,7 +52,8 @@ LBMFixedFirstOrderBC::backBoundary()
5152
if (_domain.getDim() == 2)
5253
mooseError("There is no back boundary in 2 dimensions.");
5354
else
54-
mooseError("Back boundary is not implemented, but it can be replaced by any other boundary by rotating the domain.");
55+
mooseError("Back boundary is not implemented, but it can be replaced by any other boundary by "
56+
"rotating the domain.");
5557
}
5658

5759
void
@@ -106,7 +108,7 @@ LBMFixedFirstOrderBC::leftBoundary()
106108
{
107109
torch::Tensor density = 1.0 / (1.0 - _value) *
108110
(torch::sum(_f.index({0, Slice(), Slice(), -_stencil._neutral_x}), -1) +
109-
2 * torch::sum(_f.index({0, Slice(), Slice(), _stencil._right}), -1));
111+
2 * torch::sum(_f.index({0, Slice(), Slice(), _stencil._right}), -1));
110112

111113
_u.index_put_({0, Slice(), Slice(), _stencil._left[0]},
112114
_f.index({0, Slice(), Slice(), _stencil._right[0]}) +
@@ -128,9 +130,9 @@ LBMFixedFirstOrderBC::rightBoundaryD2Q9()
128130
{
129131
torch::Tensor density = 1.0 / (1.0 + _value) *
130132
(_f.index({_grid_size[0] - 1, Slice(), Slice(), 0}) +
131-
_f.index({_grid_size[0] - 1, Slice(), Slice(), 2}) +
132-
_f.index({_grid_size[0] - 1, Slice(), Slice(), 4}) +
133-
2 * (_f.index({_grid_size[0] - 1, Slice(), Slice(), 1}) +
133+
_f.index({_grid_size[0] - 1, Slice(), Slice(), 2}) +
134+
_f.index({_grid_size[0] - 1, Slice(), Slice(), 4}) +
135+
2 * (_f.index({_grid_size[0] - 1, Slice(), Slice(), 1}) +
134136
_f.index({_grid_size[0] - 1, Slice(), Slice(), 5}) +
135137
_f.index({_grid_size[0] - 1, Slice(), Slice(), 8})));
136138

@@ -148,7 +150,7 @@ LBMFixedFirstOrderBC::rightBoundaryD2Q9()
148150
_f.index({_grid_size[0] - 1, Slice(), Slice(), _stencil._left[i]}) +
149151
0.5 * _stencil._ey[opposite_dir] *
150152
(_f.index({_grid_size[0] - 1, Slice(), Slice(), 4}) -
151-
_f.index({_grid_size[0] - 1, Slice(), Slice(), 2})) -
153+
_f.index({_grid_size[0] - 1, Slice(), Slice(), 2})) -
152154
1.0 / 6.0 * density * _value);
153155
}
154156
}
@@ -163,7 +165,7 @@ LBMFixedFirstOrderBC::rightBoundary()
163165
torch::Tensor density =
164166
1.0 / (1.0 + _value) *
165167
(torch::sum(_f.index({_grid_size[0] - 1, Slice(), Slice(), -_stencil._neutral_x}), -1) +
166-
2 * torch::sum(_f.index({_grid_size[0] - 1, Slice(), Slice(), _stencil._left}), -1));
168+
2 * torch::sum(_f.index({_grid_size[0] - 1, Slice(), Slice(), _stencil._left}), -1));
167169

168170
_u.index_put_({_grid_size[0] - 1, Slice(), Slice(), _stencil._right[0]},
169171
_f.index({_grid_size[0] - 1, Slice(), Slice(), _stencil._left[0]}) -
@@ -214,7 +216,8 @@ LBMFixedFirstOrderBC::bottomBoundary()
214216
if (_stencil._q == 9)
215217
bottomBoundaryD2Q9();
216218
else
217-
mooseError("Bottom boundary is not implemented, but it can be replaced by another boundary by rotating the domain.");
219+
mooseError("Bottom boundary is not implemented, but it can be replaced by another boundary by "
220+
"rotating the domain.");
218221
}
219222

220223
void
@@ -253,7 +256,8 @@ LBMFixedFirstOrderBC::topBoundary()
253256
if (_stencil._q == 9)
254257
topBoundaryD2Q9();
255258
else
256-
mooseError("Top boundary is not implemented, but it can be replaced by another boundary by rotating the domain.");
259+
mooseError("Top boundary is not implemented, but it can be replaced by another boundary by "
260+
"rotating the domain.");
257261
}
258262

259263
void

src/tensor_computes/LBMFixedZerothOrderBC.C

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ LBMFixedZerothOrderBC::validParams()
2424
return params;
2525
}
2626

27-
LBMFixedZerothOrderBC::LBMFixedZerothOrderBC(
28-
const InputParameters & parameters)
27+
LBMFixedZerothOrderBC::LBMFixedZerothOrderBC(const InputParameters & parameters)
2928
: LBMBoundaryCondition(parameters),
3029
_f(getInputBufferByName(getParam<TensorInputBufferName>("f"))),
3130
_grid_size(_lb_problem.getGridSize()),
@@ -39,7 +38,8 @@ LBMFixedZerothOrderBC::frontBoundary()
3938
if (_domain.getDim() == 2)
4039
mooseError("There is no front boundary in 2 dimensions.");
4140
else
42-
mooseError("Front boundary is not implemented, but it can be replaced by any other boundary by rotating the domain.");
41+
mooseError("Front boundary is not implemented, but it can be replaced by any other boundary by "
42+
"rotating the domain.");
4343
}
4444

4545
void
@@ -48,7 +48,8 @@ LBMFixedZerothOrderBC::backBoundary()
4848
if (_domain.getDim() == 2)
4949
mooseError("There is no back boundary in 2 dimensions.");
5050
else
51-
mooseError("Back boundary is not implemented, but it can be replaced by any other boundary by rotating the domain.");
51+
mooseError("Back boundary is not implemented, but it can be replaced by any other boundary by "
52+
"rotating the domain.");
5253
}
5354

5455
void
@@ -86,9 +87,9 @@ LBMFixedZerothOrderBC::leftBoundary()
8687
leftBoundaryD2Q9();
8788
else
8889
{
89-
torch::Tensor velocity =
90+
torch::Tensor velocity =
9091
1.0 - (torch::sum(_f.index({0, Slice(), Slice(), -_stencil._neutral_x}), -1) +
91-
2 * torch::sum(_f.index({0, Slice(), Slice(), _stencil._right}), -1)) /
92+
2 * torch::sum(_f.index({0, Slice(), Slice(), _stencil._right}), -1)) /
9293
_value;
9394

9495
_u.index_put_({0, Slice(), Slice(), _stencil._left[0]},
@@ -102,9 +103,8 @@ LBMFixedZerothOrderBC::leftBoundary()
102103
_f.index({0, Slice(), Slice(), _stencil._right[i]}) +
103104
2.0 * _stencil._weights[_stencil._left[i]] / _lb_problem._cs2 * _value *
104105
velocity);
105-
}
106+
}
106107
}
107-
108108
}
109109

110110
void
@@ -145,11 +145,11 @@ LBMFixedZerothOrderBC::rightBoundary()
145145
rightBoundaryD2Q9();
146146
else
147147
{
148-
torch::Tensor velocity =
149-
(torch::sum(_f.index({_grid_size[0] - 1, Slice(), Slice(), -_stencil._neutral_x}), -1) +
150-
2 * torch::sum(_f.index({_grid_size[0] - 1, Slice(), Slice(), _stencil._left}), -1)) /
151-
_value -
152-
1.0;
148+
torch::Tensor velocity =
149+
(torch::sum(_f.index({_grid_size[0] - 1, Slice(), Slice(), -_stencil._neutral_x}), -1) +
150+
2 * torch::sum(_f.index({_grid_size[0] - 1, Slice(), Slice(), _stencil._left}), -1)) /
151+
_value -
152+
1.0;
153153

154154
_u.index_put_({_grid_size[0] - 1, Slice(), Slice(), _stencil._right[0]},
155155
_f.index({_grid_size[0] - 1, Slice(), Slice(), _stencil._left[0]}) -
@@ -201,7 +201,8 @@ LBMFixedZerothOrderBC::bottomBoundary()
201201
if (_stencil._q == 9)
202202
bottomBoundaryD2Q9();
203203
else
204-
mooseError("Bottom boundary is not implemented, but it can be replaced by any other boundary by rotating the domain");
204+
mooseError("Bottom boundary is not implemented, but it can be replaced by any other boundary "
205+
"by rotating the domain");
205206
}
206207

207208
void
@@ -242,7 +243,8 @@ LBMFixedZerothOrderBC::topBoundary()
242243
if (_stencil._q == 9)
243244
topBoundaryD2Q9();
244245
else
245-
mooseError("Top boundary is not implemented, but it can be replaced by any other boundary by rotating the domain");
246+
mooseError("Top boundary is not implemented, but it can be replaced by any other boundary by "
247+
"rotating the domain");
246248
}
247249

248250
void

0 commit comments

Comments
 (0)