Chi-Tech
doc_Bb_bcs.h
Go to the documentation of this file.
1
/** \page LBSBCs Boundary Conditions
2
3
LBS supports the boundary condition `"incident_anisotropic_heterogeneous"`,
4
which allows for a very intricate type of boundary condition to be specified.
5
6
For example, consider the boundary condition applied to boundary `zmax` below:
7
\code
8
chiLBSSetOptions(phys1,
9
{
10
spatial_discretization = "pwld",
11
scattering_order = 2,
12
boundary_conditions =
13
{
14
{ name = "zmax", type = "incident_anisotropic_heterogeneous",
15
function_name = "luaBoundaryFunctionA"},
16
}
17
})
18
\endcode
19
20
It points to the lua function `"luaBoundaryFunctionA"`. This lua function will
21
be called with the following parameters:
22
```
23
size_t cell_global_id,
24
int cell_material_id,
25
unsigned int face_index,
26
unsigned int face_node_index,
27
const chi_mesh::Vector3& face_node_location,
28
const chi_mesh::Vector3& face_node_normal,
29
const std::vector<int>& quadrature_angle_indices,
30
const std::vector<chi_mesh::Vector3>& quadrature_angle_vectors,
31
const std::vector<std::pair<double,double>>& quadrature_phi_theta_angles,
32
const std::vector<int>& group_indices,
33
double evaluation_time;
34
```
35
and must return a 1D array of data-values ordered first by angle index, then
36
by group index, e.g., n0g0, n0g1, n0g2, n1g0, n1g1, n1g2, etc.
37
38
Example lua function:
39
\code
40
function luaBoundaryFunctionA(cell_global_id,
41
material_id,
42
location,
43
normal,
44
quadrature_angle_indices,
45
quadrature_angle_vectors,
46
quadrature_phi_theta_angles,
47
group_indices)
48
num_angles = rawlen(quadrature_angle_vectors)
49
num_groups = rawlen(group_indices)
50
psi = {}
51
dof_count = 0
52
53
for ni=1,num_angles do
54
omega = quadrature_angle_vectors[ni]
55
phi_theta = quadrature_phi_theta_angles[ni]
56
for gi=1,num_groups do
57
g = group_indices[gi]
58
59
value = 1.0
60
61
dof_count = dof_count + 1
62
psi[dof_count] = value
63
end
64
end
65
66
return psi
67
end
68
\endcode
69
70
An example of a very intricate use of this functionality can be seen in the
71
test \ref tests_Transport_Steady_Transport2D_5PolyA_AniHeteroBndry_lua
72
73
\ingroup LBSUtilities */
modules
LinearBoltzmannSolvers
doc
doc_Bb_bcs.h
Generated by
1.9.3