Module for computing perpendicular fluxes through domain
Creates perpendicular boundary polygons and conectivity matrices
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(perp_bnd_flux_t), | intent(inout) | :: | self |
Instance of class |
||
| class(equilibrium_t), | intent(in) | :: | equi |
Equilibrium |
||
| type(mesh_cart_t), | intent(in) | :: | mesh |
Mesh |
||
| type(penalisation_t), | intent(in) | :: | penalisation |
Penalisation |
||
| integer, | intent(in), | optional | :: | dbgout |
Debug output level |
Writes boundary polygons to netcdf file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(perp_bnd_flux_t), | intent(in) | :: | self |
Instance of class |
||
| integer, | intent(in) | :: | fgid |
File or group id |
Reads boundary polygon information from netcdf file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(perp_bnd_flux_t), | intent(inout) | :: | self |
Instance of class |
||
| integer, | intent(in) | :: | fgid |
File or group id |
Destructor
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(perp_bnd_flux_t), | intent(inout) | :: | self |
Instance of type |
Wrapper type for managing perpendicular fluxes
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(polygon_in_mesh_t), | public | :: | core |
Polygon for core boundary |
|||
| type(csrmat_t), | public | :: | conn_core |
Connectivity matrix for core polygon |
|||
| type(polygon_in_mesh_t), | public | :: | outer |
Polygon for outer boundary This consists of the wall and dome excluding the part within the penalisation and the target |
|||
| type(csrmat_t), | public | :: | conn_outer |
Connectivity matrix for outer polygon |
|||
| type(polygon_in_mesh_t), | public | :: | target |
Polygon for target boundary |
|||
| type(csrmat_t), | public | :: | conn_target |
Connectivity matrix for target polygon |
|||
| integer, | public, | dimension(:), allocatable | :: | full_to_inner |
Index map of full mesh indices to corresponding inner mesh index (if it exists) Full indices without associated inner index have value 0 |
| final :: destructor |
| procedure , public :: init => init_perp_bnd_flux Interface | |
| procedure , public :: write_netcdf => write_netcdf_perp_bnd_flux Interface | |
| procedure , public :: read_netcdf => read_netcdf_perp_bnd_flux Interface |
Computes total flux through polygon segment from diff_flux array, which has to be computed previously via compute_diffusive_flux.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(comm_handler_t), | intent(in) | :: | comm_handler |
Communicators |
||
| type(polygon_in_mesh_t), | intent(in) | :: | polygon |
Polygon |
||
| real(kind=GP), | intent(in), | dimension(polygon%get_np_total()) | :: | diff_flux |
Diffusive flux through boundary in between polygon points and its connected points obtained from compute_diffusive_flux |
|
| logical, | intent(in) | :: | sum_over_planes |
If true summation over planes is performed. This assumes that polygons have same structure over planes |
||
| integer, | intent(in), | optional | :: | iseg |
Segment for which flux is computed. If not present then flux summed over all segments is returned |
Computes local flux through polygon point (area associated with polygon point) diff_flux array has to be computed previously via compute_diffusive_flux
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(polygon_in_mesh_t), | intent(in) | :: | polygon |
Polygon |
||
| real(kind=GP), | intent(in), | dimension(polygon%get_np_total()) | :: | diff_flux |
Diffusive flux through boundary in between polygon points and its connected points obtained from compute_diffusive_flux |
|
| integer, | intent(in) | :: | ks |
Index on polygon segment If index does not exist on segment, zero flux is returned |
||
| integer, | intent(in), | optional | :: | iseg |
Segment for which flux is computed, default = 1 |
Computes total flux through polygon segment from drift_flux array, which has to be computed previously via compute_drift_flux. $omp parallel default(none) private(is, ks, ks_glob) & $omp shared(polygon, iseg_start, iseg_end, nexclude_last, drift_flux, res) $omp do reduction(+ : res) $omp end do $omp end parallel
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(comm_handler_t), | intent(in) | :: | comm_handler |
Communicators |
||
| type(polygon_in_mesh_t), | intent(in) | :: | polygon |
Polygon |
||
| real(kind=GP), | intent(in), | dimension(polygon%get_np_total()) | :: | drift_flux |
Drift flux through boundary in between polygon points, obtained via compute_drift_flux routine |
|
| logical, | intent(in) | :: | sum_over_planes |
If true summation over planes is performed. This assumes that polygons have same structure over planes |
||
| integer, | intent(in), | optional | :: | iseg |
Segment for which flux is computed. If not present then flux summed over all segments is returned |
Computes local flux through polygon point (area associated with polygon point) drift_flux array has to be computed previously via compute_drift_flux
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(polygon_in_mesh_t), | intent(in) | :: | polygon |
Polygon |
||
| real(kind=GP), | intent(in), | dimension(polygon%get_np_total()) | :: | drift_flux |
Drift flux through boundary in between polygon points, obtained via compute_drift_flux routine |
|
| integer, | intent(in) | :: | ks |
Index on polygon segment If index does not exist on segment, zero flux is returned |
||
| integer, | intent(in), | optional | :: | iseg |
Segment for which flux is computed, default = 1 |
Sets points of field u on boundary-polygon to the value of its connected inner points, according to connectivity matrix conn.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(equilibrium_t), | intent(in) | :: | equi |
Equilibrium |
||
| type(mesh_cart_t), | intent(in) | :: | mesh |
Mesh |
||
| type(polygon_in_mesh_t), | intent(in) | :: | polygon |
Polygon |
||
| type(csrmat_t), | intent(in) | :: | conn |
Connectivity matrix |
||
| real(kind=GP), | intent(inout), | dimension(mesh%get_n_points()) | :: | u |
Field |
|
| real(kind=GP), | intent(in), | optional, | dimension(mesh%get_n_points()) | :: | co |
Coefficient |
| integer, | intent(in), | optional | :: | iseg |
Segment for which miroring is applied. By default it is applied to all segments. |
Computes the diffusive flux through a perpendicular boundary polygon, i.e. \int_S v \nabla u dS, where nabla is gradient within plane Sign convention is that flux out of inner domain is positive
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(equilibrium_t), | intent(in) | :: | equi |
Equilibrium |
||
| type(mesh_cart_t), | intent(in) | :: | mesh |
Mesh |
||
| real(kind=GP), | intent(in) | :: | dphi |
Toroidal extent of surface |
||
| type(polygon_in_mesh_t), | intent(in) | :: | polygon |
Polygon |
||
| type(csrmat_t), | intent(in) | :: | conn |
Connectivity matrix |
||
| real(kind=GP), | intent(in), | dimension(mesh%get_n_points()) | :: | u |
Field |
|
| real(kind=GP), | intent(out), | dimension(polygon%get_np_total()) | :: | diff_flux |
Diffusive flux through boundary polygon points (its associated area) |
|
| real(kind=GP), | intent(in), | optional, | dimension(mesh%get_n_points()) | :: | co |
Coefficient |
Computes fluxes due to drift through a toroidally extended polygon \int_S v * (B/B^2 \times \nabla u) dS The integrand can be expressed via a derivative along the polygon \int v * 1/Btor du/dl J dl dphi where l measures the length along the polygon $omp parallel default(none) & $omp private(iseg, ks, ks_glob, l, lfwd, x, y, xfwd, yfwd, & $omp jac_av, btor_av, v_av) & $omp shared(equi, equi_storage, mesh, dphi, polygon, phi, nexclude_last, & $omp u, v, drift_flux) $omp do $omp end do $omp end parallel
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(equilibrium_t), | intent(in) | :: | equi |
Equilibrium |
||
| type(equilibrium_storage_t), | intent(in) | :: | equi_storage |
Equilibrium on mesh |
||
| type(mesh_cart_t), | intent(in) | :: | mesh |
Mesh |
||
| real(kind=GP), | intent(in) | :: | dphi |
Toroidal extent of surface |
||
| type(polygon_in_mesh_t), | intent(in) | :: | polygon |
Polygon |
||
| real(kind=GP), | intent(in), | dimension(mesh%get_n_points()) | :: | u |
Field |
|
| real(kind=GP), | intent(out), | dimension(polygon%get_np_total()) | :: | drift_flux |
Drift flux through boundary in between polygon points This quantity is difficult to interpret, use the getter routines ... to compute the local or integrated fluxes |
|
| real(kind=GP), | intent(in), | optional, | dimension(mesh%get_n_points()) | :: | v |
Optional field, default values 1 |