# mus_compute_Poisson_module Module

This module provides the definition and methods to solve poisson equation. author: Kannan Masilamani Implementation is based on: Luo, K., Wu, J., Yi, H., & Tan, H. (2016). International Journal of Heat and Mass Transfer Lattice Boltzmann modelling of electro-thermo-convection in a planar layer of dielectric liquid subjected to unipolar injection and thermal gradient. International Journal of Heat and Mass Transfer, 103, 832–846.

Guo, Z. (2014). A Coupled Lattice Boltzmann Method to Solve Nernst – Planck Model for Simulating Electro-osmotic Flows. Journal of Scientific Computing, (61), 222–238. http://doi.org/10.1007/s10915-014-9820-6

This implementation solve equation of the form is the source term For Poisson Eq: For Poisson Boltzmann Linear Eq: For Poisson Boltzmann nonLinear Eq: For 1:1 Electrolye solution, above equation is simplied to

## Variables

TypeVisibilityAttributesNameInitial
integer, private, parameter:: QQ_27 =27
integer, private, parameter:: QQ_19 =19
integer, private, parameter:: qN00 =1
integer, private, parameter:: q0N0 =2
integer, private, parameter:: q00N =3
integer, private, parameter:: q100 =4
integer, private, parameter:: q010 =5
integer, private, parameter:: q001 =6
integer, private, parameter:: q0NN =7
integer, private, parameter:: q0N1 =8
integer, private, parameter:: q01N =9
integer, private, parameter:: q011 =10
integer, private, parameter:: qN0N =11
integer, private, parameter:: q10N =12
integer, private, parameter:: qN01 =13
integer, private, parameter:: q101 =14
integer, private, parameter:: qNN0 =15
integer, private, parameter:: qN10 =16
integer, private, parameter:: q1N0 =17
integer, private, parameter:: q110 =18
integer, private, parameter:: q000_19 =19
integer, private, parameter:: qNNN =19
integer, private, parameter:: qNN1 =20
integer, private, parameter:: qN1N =21
integer, private, parameter:: qN11 =22
integer, private, parameter:: q1NN =23
integer, private, parameter:: q1N1 =24
integer, private, parameter:: q11N =25
integer, private, parameter:: q111 =26
integer, private, parameter:: q000_27 =27
integer, private, parameter:: QQ_9 =9
integer, private, parameter:: qN0 =1
integer, private, parameter:: q0N =2
integer, private, parameter:: q10 =3
integer, private, parameter:: q01 =4
integer, private, parameter:: qNN =5
integer, private, parameter:: qN1 =6
integer, private, parameter:: q1N =7
integer, private, parameter:: q11 =8
integer, private, parameter:: q00_9 =9

## Subroutines

### public subroutine mus_Poisson_advRel_d2q9(fieldProp, inState, outState, auxField, neigh, nElems, nSolve, level, layout, params, varSys, derVarPos)

Advection relaxation routine for the poisson equation with an explicit calculation of all equilibrium quantities. Slow and simple. The right hand side of equation is added as a source term in mus_apply_sourceTerms routine

#### Arguments

TypeIntentOptionalAttributesName
type(mus_field_prop_type), intent(in) :: fieldProp(:)

Array of field properties (fluid or species)

real(kind=rk), intent(in) :: inState(nElems*varSys%nScalars)

input pdf vector

real(kind=rk), intent(out) :: outState(nElems*varSys%nScalars)

output pdf vector

real(kind=rk), intent(inout) :: auxField(nElems*varSys%nAuxScalars)

Auxiliary field computed from pre-collision state Is updated with correct velocity field for multicomponent models

integer, intent(in) :: neigh(nElems*layout%fStencil%QQ)

connectivity vector

integer, intent(in) :: nElems

number of elements in state Array

integer, intent(in) :: nSolve

number of elements solved in kernel

integer, intent(in) :: level

current level

type(mus_scheme_layout_type), intent(in) :: layout

current layout

type(mus_param_type), intent(in) :: params

global parameters

type(tem_varSys_type), intent(in) :: varSys

variable system definition

type(mus_derVarPos_type), intent(in) :: derVarPos(:)

position of derived quantities in varsys for all fields

### public subroutine mus_Poisson_advRel_generic(fieldProp, inState, outState, auxField, neigh, nElems, nSolve, level, layout, params, varSys, derVarPos)

Advection relaxation routine for the poisson equation with an explicit calculation of all equilibrium quantities. Slow and simple. The right hand side of equation is added as a source term in mus_apply_sourceTerms routine

#### Arguments

TypeIntentOptionalAttributesName
type(mus_field_prop_type), intent(in) :: fieldProp(:)

Array of field properties (fluid or species)

real(kind=rk), intent(in) :: inState(nElems*varSys%nScalars)

input pdf vector

real(kind=rk), intent(out) :: outState(nElems*varSys%nScalars)

output pdf vector

real(kind=rk), intent(inout) :: auxField(nElems*varSys%nAuxScalars)

Auxiliary field computed from pre-collision state Is updated with correct velocity field for multicomponent models

integer, intent(in) :: neigh(nElems*layout%fStencil%QQ)

connectivity vector

integer, intent(in) :: nElems

number of elements in state Array

integer, intent(in) :: nSolve

number of elements solved in kernel

integer, intent(in) :: level

current level

type(mus_scheme_layout_type), intent(in) :: layout

current layout

type(mus_param_type), intent(in) :: params

global parameters

type(tem_varSys_type), intent(in) :: varSys

variable system definition

type(mus_derVarPos_type), intent(in) :: derVarPos(:)

position of derived quantities in varsys for all fields

### public subroutine mus_PBLinear_advRel_generic(fieldProp, inState, outState, auxField, neigh, nElems, nSolve, level, layout, params, varSys, derVarPos)

Advection relaxation routine for the linear poisson boltzmann equation with an explicit calculation of all equilibrium quantities. Slow and simple. Where k^2 is inverse of debye length and in this kernel refered as RHS_coeff

#### Arguments

TypeIntentOptionalAttributesName
type(mus_field_prop_type), intent(in) :: fieldProp(:)

Array of field properties (fluid or species)

real(kind=rk), intent(in) :: inState(nElems*varSys%nScalars)

input pdf vector

real(kind=rk), intent(out) :: outState(nElems*varSys%nScalars)

output pdf vector

real(kind=rk), intent(inout) :: auxField(nElems*varSys%nAuxScalars)

Auxiliary field computed from pre-collision state Is updated with correct velocity field for multicomponent models

integer, intent(in) :: neigh(nElems*layout%fStencil%QQ)

connectivity vector

integer, intent(in) :: nElems

number of elements in state Array

integer, intent(in) :: nSolve

number of elements solved in kernel

integer, intent(in) :: level

current level

type(mus_scheme_layout_type), intent(in) :: layout

current layout

type(mus_param_type), intent(in) :: params

global parameters

type(tem_varSys_type), intent(in) :: varSys

variable system definition

type(mus_derVarPos_type), intent(in) :: derVarPos(:)

position of derived quantities in varsys for all fields

### public subroutine mus_PBnonLinear_advRel_generic(fieldProp, inState, outState, auxField, neigh, nElems, nSolve, level, layout, params, varSys, derVarPos)

Advection relaxation routine for the nonlinear poisson boltzmann equation for electrolyte solution

#### Arguments

TypeIntentOptionalAttributesName
type(mus_field_prop_type), intent(in) :: fieldProp(:)

Array of field properties (fluid or species)

real(kind=rk), intent(in) :: inState(nElems*varSys%nScalars)

input pdf vector

real(kind=rk), intent(out) :: outState(nElems*varSys%nScalars)

output pdf vector

real(kind=rk), intent(inout) :: auxField(nElems*varSys%nAuxScalars)

Auxiliary field computed from pre-collision state Is updated with correct velocity field for multicomponent models

integer, intent(in) :: neigh(nElems*layout%fStencil%QQ)

connectivity vector

integer, intent(in) :: nElems

number of elements in state Array

integer, intent(in) :: nSolve

number of elements solved in kernel

integer, intent(in) :: level

current level

type(mus_scheme_layout_type), intent(in) :: layout

current layout

type(mus_param_type), intent(in) :: params

global parameters

type(tem_varSys_type), intent(in) :: varSys

variable system definition

type(mus_derVarPos_type), intent(in) :: derVarPos(:)

position of derived quantities in varsys for all fields