private function spongeLayer_plane_polyn5_for_treeids(me, treeIds, tree, n) result(res)
This function calculates the sigma for the spongelayer using
polynomial order 5 from treeids.
Sponge profile:
where, \sigma_A - sponge strength, L - thickness, x0 - start of sponge.
Profile is taken from:
Xu, Hui; Sagaut, Pierre (2013): Analysis of the absorbing layers for the
weakly-compressible lattice Boltzmann methods. In Journal of Computational
Physics 245, pp. 14-42. DOI: 10.1016/j.jcp.2013.02.051.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
function spongeLayer_plane_polyn5_for_treeids(me,treeids,tree,n)&&result(res)! --------------------------------------------------------------------------!> Spatial absorb layer to evaluatetype(tem_spongeLayer_plane_type)::me!> Number of arrays to returninteger,intent(in)::n!> global treelm meshtype(treelmesh_type),intent(in)::tree!> treeIds of elements in given levelinteger(kind=long_k),intent(in)::treeIds(n)!> return valuereal(kind=rk)::res(n)! --------------------------------------------------------------------------integer::ireal(kind=rk)::sigma,origin(3),normal(3),vec1(3),vec2(3),coord(3)real(kind=rk)::proj_len1,proj_len2,const_fac! --------------------------------------------------------------------------origin(:)=me%originnormal(:)=me%normalconst_fac=3125_rk/(256_rk*me%thickness**5)do i=1,n!barycentric coordinatecoord=tem_BaryOfId(tree,treeIds(i))vec1(:)=coord(:)-origin(:)vec2(:)=me%thickness*normal(:)+origin(:)-coord(:)proj_len1=vec1(1)*normal(1)+vec1(2)*normal(2)+vec1(3)*normal(3)proj_len2=vec2(1)*normal(1)+vec2(2)*normal(2)+vec2(3)*normal(3)if(proj_len1>0.and.proj_len2>0)thensigma=const_fac*proj_len2*(proj_len1**4)res(i)=sigma*me%dampFactorelse if(proj_len2<0)then! If coord is beyond thicknessres(i)=me%dampFactorelseres(i)=0.0_rkend if end do end function spongeLayer_plane_polyn5_for_treeids