Skip to main content
Log in

RKPM2D: an open-source implementation of nodally integrated reproducing kernel particle method for solving partial differential equations

  • Published:
Computational Particle Mechanics Aims and scope Submit manuscript

Abstract

We present an open-source software RKPM2D for solving PDEs under the reproducing kernel particle method (RKPM)-based meshfree computational framework. Compared to conventional mesh-based methods, RKPM provides many attractive features, such as arbitrary order of continuity and discontinuity, relaxed tie between the quality of the discretization and the quality of approximation, simple h-adaptive refinement, and ability to embed physics-based enrichment functions, among others, which make RKPM promising for solving challenging engineering problems. The aim of the present software package is to support reproducible research and serve as an efficient test platform for further development of meshfree methods. The RKPM2D software consists of a set of data structures and subroutines for discretizing two-dimensional domains, nodal representative domain creation by Voronoi diagram partitioning, boundary condition specification, reproducing kernel shape function generation, domain integrations with stabilization, a complete meshfree solver, and visualization tools for post-processing. In this paper, a brief overview that covers the key theoretical aspects of RKPM is given, such as the reproducing kernel approximation, weak form using Nitsche’s method for boundary condition enforcement, various domain integration schemes (Gauss quadrature and stabilized nodal integration methods), as well as the fully discrete equations. In addition, the computer implementation aspects employed in RKPM2D are discussed in detail. Benchmark problems solved by RKPM2D are presented to demonstrate the convergence, efficiency, and robustness of the RKPM implementation.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20
Fig. 21
Fig. 22

Similar content being viewed by others

References

  1. Chen J-S, Pan C, Wu C-T, Liu WK (1996) Reproducing kernel particle methods for large deformation analysis of non-linear structures. Comput Methods Appl Mech Eng 139(1–4):195–227

    MathSciNet  MATH  Google Scholar 

  2. Chen J-S, Hillman M, Chi S-W (2017) Meshfree methods: progress made after 20 years. J Eng Mech 143(4):04017001

    Google Scholar 

  3. Liu WK, Jun S, Zhang YF (1995) Reproducing kernel particle methods. Int J Numer Methods Fluids 20(8–9):1081–1106

    MathSciNet  MATH  Google Scholar 

  4. Liu WK, Hao S, Belytschko T, Li S, Chang CT (1999) Multiple scale meshfree methods for damage fracture and localization. Comput Mater Sci 16(1–4):197–205

    Google Scholar 

  5. Li S, Hao W, Liu WK (2000) Mesh-free simulations of shear banding in large deformation. Int J Solids Struct 37(48–50):7185–7206

    MATH  Google Scholar 

  6. Liu WK, Jun S, Sihling DT, Chen Y, Hao W (1997) Multiresolution reproducing kernel particle method for computational fluid dynamics. Int J Numer Methods Fluids 24(12):1391–1415

    MathSciNet  MATH  Google Scholar 

  7. Liu WK, Chen Y (1995) Wavelet and multiple scale reproducing kernel methods. Int J Numer Methods Fluids 21(10):901–931

    MathSciNet  MATH  Google Scholar 

  8. Liu WK, Chen Y, Uras RA, Chang CT (1996) Generalized multiple scale reproducing kernel particle methods. Comput Methods Appl Mech Eng 139(1–4):91–157

    MathSciNet  MATH  Google Scholar 

  9. Ruter MO, Chen J-S (2017) An enhanced-strain error estimator for Galerkin meshfree methods based on stabilized conforming nodal integration. Comput Math Appl 74(9):2144–2171

    MathSciNet  MATH  Google Scholar 

  10. You Y, Chen J-S, Lu H (2003) Filters, reproducing kernel, and adaptive meshfree method. Comput Mech 31(3–4):316–326

    MATH  Google Scholar 

  11. Chen J-S, Hillman M, Ruter M (2013) An arbitrary order variationally consistent integration for Galerkin meshfree methods. Int J Numer Methods Eng 95(5):387–418

    MathSciNet  MATH  Google Scholar 

  12. Hillman M, Chen J-S (2016) An accelerated, convergent, and stable nodal integration in Galerkin meshfree methods for linear and nonlinear mechanics. Int J Numer Methods Eng 107(7):603–630

    MathSciNet  MATH  Google Scholar 

  13. Chen J-S, Wang D (2006) A constrained reproducing kernel particle formulation for shear deformable shell in Cartesian coordinates. Int J Numer Methods Eng 68(2):151–172

    MATH  Google Scholar 

  14. Kim NH, Choi KK, Chen J-S, Botkin ME (2002) Meshfree analysis and design sensitivity analysis for shell structures. Int J Numer Methods Eng 53(9):2087–2116

    MATH  Google Scholar 

  15. Chen J-S, Pan C, Roque C, Wang H-P (1998) A Lagrangian reproducing kernel particle method for metal forming analysis. Comput Mech 22(3):289–307

    MATH  Google Scholar 

  16. Chen J-S, Wang H-P, Yoon S, You Y (2000) Some recent improvements in meshfree methods for incompressible finite elasticity boundary value problems with contact. Comput Mech 25(2–3):137–156

    MATH  Google Scholar 

  17. Wang H-P, Wu C-T, Chen J-S (2014) A reproducing kernel smooth contact formulation for metal forming simulations. Comput Mech 54(1):151–169

    MathSciNet  MATH  Google Scholar 

  18. Chen J-S, Basava RR, Zhang Y, Csapo R, Malis V, Sinha U, Hodgson J, Sinha S (2016) Pixel-based meshfree modelling of skeletal muscles. Comput Methods Biomech Biomed Eng Imaging Vis 4(2):73–85

    Google Scholar 

  19. Wei H, Chen J-S, Hillman M (2016) A stabilized nodally integrated meshfree formulation for fully coupled hydro-mechanical analysis of fluid-saturated porous media. Comput Fluids 141:105–115

    MathSciNet  MATH  Google Scholar 

  20. Wei H, Chen J-S, Beckwith F, Baek J (2019) A naturally stabilized semi-Lagrangian meshfree formulation for multiphase porous media with application to landslide modeling. J Eng Mech. https://doi.org/10.1061/(ASCE)EM.1943-7889.0001729

    Article  Google Scholar 

  21. Chen J-S, Wu C-T, Belytschko T (2000) Regularization of material instabilities by meshfree approximations with intrinsic length scales. Int J Numer Methods Eng 47(7):1303–1322

    MATH  Google Scholar 

  22. Chen J-S, Zhang X, Belytschko T (2004) An implicit gradient model by a reproducing kernel strain regularization in strain localization problems. Comput Methods Appl Mech Eng 193(27–29):2827–2844

    MATH  Google Scholar 

  23. Wei H, Chen J-S (2018) A damage particle method for smeared modeling of brittle fracture. Int J Multiscale Comput Eng 16(4):303–324

    Google Scholar 

  24. Roth MJ, Chen J-S, Slawson TR, Danielson KT (2016) Stable and flux-conserved meshfree formulation to model shocks. Comput Mech 57(5):773–792

    MathSciNet  MATH  Google Scholar 

  25. Roth MJ, Chen J-S, Danielson KT, Slawson TR (2016) Hydrodynamic meshfree method for high-rate solid dynamics using a Rankine–Hugoniot enhancement in a Riemann-SCNI framework. Int J Numer Methods Eng 108(12):1525–1549

    MathSciNet  Google Scholar 

  26. Huang T-H, Chen J-S, Wei H, Roth MJ, Sherburn JA, Bishop JE, Tupek MR, Fang EH (2019) A MUSCL-SCNI approach for meshfree modeling of shock waves in fluids. Comput Part Mech. https://doi.org/10.1007/s40571-019-00248-x

    Article  Google Scholar 

  27. Guan P-C, Chi S-W, Chen J-S, Slawson T, Roth MJ (2011) Semi-Lagrangian reproducing kernel particle method for fragment-impact problems. Int J Impact Eng 38(12):1033–1047

    Google Scholar 

  28. Sherburn JA, Roth MJ, Chen J, Hillman M (2015) Meshfree modeling of concrete slab perforation using a reproducing kernel particle impact and penetration formulation. Int J Impact Eng 86:96–110

    Google Scholar 

  29. Chi S-W, Lee C-H, Chen J-S, Guan P-C (2015) A level set enhanced natural kernel contact algorithm for impact and penetration modeling. Int J Numer Methods Eng 102(34):839–866

    MathSciNet  MATH  Google Scholar 

  30. Chen J-S, Liu WK, Hillman M, Chi S-W, Lian Y, Bessa M (2017) Reproducing kernel particle method for solving partial differential equations. In: Stein E, De Borst R, Hughes TJR (eds) Encyclopedia of computational mechanics, 2nd edn. Wiley, Chichester, pp 1–44

    Google Scholar 

  31. Hardee E, Chang K-H, Yoon S, Kaneko M, Grindeanu I, Chen J-S (1999) A structural nonlinear analysis workspace (SNAW) based on meshless methods. Adv Eng Softw 30(30):153–175

    Google Scholar 

  32. Hsieh Y-M, Pan M-S (2014) ESFM: an essential software framework for meshfree methods. Adv Eng Softw 76:133–147

    Google Scholar 

  33. Barbieri E, Meo M (2012) A fast object-oriented Matlab implementation of the reproducing kernel particle method. Comput Mech 49(5):581–602

    MathSciNet  MATH  Google Scholar 

  34. Cartwright C, Oliveira S, Stewart DE (2006) Parallel support set searches for meshfree methods. SIAM J Sci Comput 28(4):1318–1334

    MathSciNet  MATH  Google Scholar 

  35. Parreira GF, Fonseca AR, Lisboa AC, Silva EJ, Mesquita RC (2006) Efficient algorithms and data structures for element-free Galerkin method. IEEE Trans Magn 42(4):659–662

    Google Scholar 

  36. Olliff J, Alford B, Simkins DC (2018) Efficient searching in meshfree methods. Comput Mech 62(6):1461–1483

    MathSciNet  MATH  Google Scholar 

  37. Chen J-S, Hillman M, Huang T-H, Wei H (2019) RKPM2D: an open-source implementation of nodally integrated reproducing kernel particle method for solving partial differential equations. Mendeley Data. https://doi.org/10.17632/prfxg9cbrx

  38. Nitsche J (1970–1971) Uber ein Variationsprinzip zur Losung von Dirichlet-Problemen bei Verwendung von Teilraumen, die keinen Randbedingungen unterworfen sind. Abh Math Sem Univ Hamburg 36: 9–15

    MathSciNet  MATH  Google Scholar 

  39. Fernandez-Mendez S, Huerta A (2004) Imposing essential boundary conditions in mesh-free methods. Comput Methods Appl Mech Eng 193(12–14):1257–1275

    MathSciNet  MATH  Google Scholar 

  40. Chen J-S, Wu C-T, Yoon S, You Y (2001) A stabilized conforming nodal integration for Galerkin mesh-free methods. Int J Numer Methods Eng 50(2):435–466

    MATH  Google Scholar 

  41. Chen J-S, Hu W, Puso M, Wu Y, Zhang X (2007) Strain smoothing for stabilization and regularization of Galerkin meshfree methods. In: Schweitzer MA (ed) Meshfree methods for partial differential equations III. Springer, Berlin, pp 57–75

    Google Scholar 

  42. MATLAB Release 2019a (2019) The MathWorks Inc., Natick

  43. Li S, Liu WK (2007) Meshfree particle methods. Springer, Berlin

    MATH  Google Scholar 

  44. Chen J-S, Wang H-P (2000) New boundary condition treatments in meshfree computation of contact problems. Comput Methods Appl Mech Eng 187(3–4):441–468

    MathSciNet  MATH  Google Scholar 

  45. Dolbow J, Belytschko T (1999) Numerical integration of the Galerkin weak form in meshfree methods. Comput Mech 23(3):219–230

    MathSciNet  MATH  Google Scholar 

  46. Lu Y, Belytschko T, Gu L (1994) A new implementation of the element free Galerkin method. Comput Methods Appl Mech Eng 113(3–4):397–414

    MathSciNet  MATH  Google Scholar 

  47. Puso MA, Zywicz E, Chen J (2007) A new stabilized nodal integration approach. In: Schweitzer MA (ed) Meshfree methods for partial differential equations III. Springer, Berlin, pp 207–217

    Google Scholar 

  48. Sievers J (2016) Constrain the vertices of a Voronoi decomposition to the domain of the input data. MathWorks, 31th October 2016. http://se.mathworks.com/matlabcentral/fileexchange/34428-voronoilimit. Accessed 1st Sept 2018

  49. Bentley JL (1975) Multidimensional binary search trees used for associative searching. Commun ACM 18(9):509–517

    MathSciNet  MATH  Google Scholar 

  50. Perkins E, Williams JR (2001) A fast contact detection algorithm insensitive to object sizes. Eng Comput 18(1/2):48–62

    MATH  Google Scholar 

  51. Friedman JH, Bentley JL, Finkel RA (1976) An algorithm for finding best matches in logarithmic time. ACM Trans Math Softw 3(SLAC-PUB-1549-REV. 2):209–226

    MATH  Google Scholar 

  52. Steger C (1996) On the calculation of arbitrary moments of polygons. Munchen University, Technical Report FGBV-96-05, Munchen, Germany

  53. Gilbert JR, Moler C, Schreiber R (1992) Sparse matrices in MATLAB: design and implementation. SIAM J Matrix Anal Appl 13(1):333–356

    MathSciNet  MATH  Google Scholar 

  54. Saad Y (2003) Iterative methods for sparse linear systems. SIAM, Minneapolis

    MATH  Google Scholar 

  55. Shestakov A, Kershaw D, Zimmerman G (1990) Test problems in radiative transfer calculations. Nucl Sci Eng 105(1):88–104

    Google Scholar 

Download references

Acknowledgements

The support from Sandia National Laboratories under the Contract 1655264 to the University of California, San Diego, is greatly appreciated.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Haoyan Wei.

Ethics declarations

Conflict of interest

On behalf of all authors, the corresponding author states that there is no conflict of interest.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendices

Appendix A

In RKPM2D, six kernel functions with different levels of continuity are implemented, as described in Table 1, and the corresponding mathematical expressions of these kernel functions are given as follows.

  1. 1.

    The Heaviside kernel function:

    $$ \varPhi_{a} \left( {\varvec{x} - \varvec{x}_{I} } \right) = \left\{ {\begin{array}{*{20}c} {\begin{array}{*{20}c} 1 \\ 0 \\ \end{array} } & {\begin{array}{*{20}c} {\text{for}} \\ {\text{for}} \\ \end{array} } & {\begin{array}{*{20}c} {0 \le z_{I} \le 1,} \\ {z_{I} > 1} \\ \end{array} } \\ \end{array} } \right. $$
    (68)
  2. 2.

    The linear B-spline (tent) kernel function:

    $$ \varPhi_{a} \left( {\varvec{x} - \varvec{x}_{I} } \right) = \left\{ {\begin{array}{*{20}l} {\begin{array}{*{20}l} {1 - z_{I} } \\ 0 \\ \end{array} } & {\begin{array}{*{20}l} {\text{for}} \\ {\text{for}} \\ \end{array} } & {\begin{array}{*{20}l} {0 \le z_{I} \le 1,} \\ {z_{I} > 1} \\ \end{array} } \\ \end{array} } \right. $$
    (69)
  3. 3.

    The quadratic B-spline kernel function:

    $$ \varPhi_{a} \left( {\varvec{x} - \varvec{x}_{I} } \right) = \left\{ {\begin{array}{*{20}l} {1 - 3z_{I}^{2} } \\ {3/2 - 3z_{I} + 3/2z_{I}^{2} } \\ 0 \\ \end{array} } \right.\begin{array}{*{20}l} {\text{for}} \\ {\text{for}} \\ {\text{for}} \\ \end{array} \begin{array}{*{20}l} {0 \le z_{I} \le 1/3,} \\ {1/3 \le z_{I} \le 1,} \\ {z_{I} > 1} \\ \end{array} $$
    (70)
  4. 4.

    The cubic B-spline kernel function:

    $$ \varPhi_{a} \left( {\varvec{x} - \varvec{x}_{I} } \right) = \left\{ {\begin{array}{*{20}l} {2/3 - 4z_{I}^{2} + 4z_{I}^{3} } \\ {4/3 - 4z_{I} + 4z_{I}^{2} - 4/3z_{I}^{3} } \\ 0 \\ \end{array} } \right.\begin{array}{*{20}l} \quad{\text{for}} \\ \quad {\text{for}} \\ \quad{\text{for}} \\ \end{array} \begin{array}{*{20}l} \quad {0 \le z_{I} \le 1/2,} \\ \quad {1/2 \le z_{I} \le 1,} \\ \quad{z_{I} > 1} \\ \end{array} $$
    (71)
  5. 5.

    The quartic B-spline kernel function:

    $$ \begin{aligned} & \varPhi_{a} \left( {\varvec{x} - \varvec{x}_{I} } \right) = \\ & \left\{ {\begin{array}{*{20}l} {1 - \frac{150}{23}z_{I}^{2} + \frac{375}{23}z_{I}^{4} } \hfill & { {\text{for}} 0 \le z_{I} \le \frac{1}{5},} \hfill \\ {\frac{22}{23} + \frac{20}{23}z_{I} - \frac{300}{23}z_{I}^{2} + \frac{500}{23}z_{I}^{3} - \frac{250}{23}z_{I}^{4} } \hfill & {{\text{for}} \frac{1}{5} \le z_{I} \le \frac{3}{5},} \hfill \\ {\frac{125}{46} - \frac{250}{23} z_{I} + \frac{375}{23}z_{I}^{2} - \frac{250}{23}z_{I}^{3} + \frac{125}{46}z_{I}^{4} } \hfill & {{\text{for}} \frac{3}{5} \le z_{I} \le 1,} \hfill \\ 0 \hfill & { {\text{for}} z_{I} > 1} \hfill \\ \end{array} } \right. \\ \end{aligned} $$
    (72)
  6. 6.

    The quintic B-spline kernel function:

    $$ \begin{aligned} & \varPhi_{a} \left( {\varvec{x} - \varvec{x}_{I} } \right) = \\ & \left\{ {\begin{array}{*{20}l} {1 - \frac{90}{11}z_{I}^{2} + \frac{405}{11}z_{I}^{4} - \frac{405}{11}z_{I}^{5} } \hfill & {{\text{for}}\,\, 0 \le z_{I} \le \frac{1}{3},} \hfill \\ {\frac{17}{22} + \frac{75}{22} z_{I} - \frac{315}{11}z_{I}^{2} + \frac{674}{11}z_{I}^{3} - \frac{1215}{22}z_{I}^{4} + \frac{405}{22}z_{I}^{5} } \hfill & {{\text{for}}\,\, \frac{1}{3} \le z_{I} \le \frac{2}{3},} \hfill \\ {\frac{81}{22} - \frac{405}{22} z_{I} + \frac{405}{11}z_{I}^{2} - \frac{405}{11}z_{I}^{3} + \frac{405}{22}z_{I}^{4} - \frac{81}{22}z_{I}^{5} } \hfill & {{\text{for}}\,\, \frac{2}{3} \le z_{I} \le 1,} \hfill \\ 0 \hfill & {{\text{for}}\,\, z_{I} > 1} \hfill \\ \end{array} } \right. \\ \end{aligned} $$
    (73)

Appendix B

In this section, a diffusion problem is used as example to illustrate how to modify RKPM2D for the solution of different types of PDEs. A diffusion equation is considered as follows:

$$ \begin{array}{*{20}l} {\left( {D_{ij} u_{,j} } \right)_{,i} + b = 0} \hfill & {{\text{on}}\,\varvec{ }\varOmega } \hfill \\ {D_{ij} u_{,j} n_{i} = t} \hfill & {{\text{on}}\,\partial \varOmega_{t} } \hfill \\ {u = g} \hfill & {{\text{on}}\,\partial \varOmega_{g} } \hfill \\ \end{array} $$
(74)

where \( u \) is a scalar field, \( D_{ij} \) is the diffusivity, \( b \) is the source term, and \( t \) and \( g \) are the prescribed boundary flux and boundary values of \( u \) on \( \partial \varOmega_{t} \) and \( \partial \varOmega_{g} \), respectively. By introducing the RK approximation in Eq. (11), (74) can be recast into the following matrix equations for isotropic scalar diffusivity:

$$ \mathop \sum \limits_{J} K_{IJ} u_{J} - F_{I} = 0 $$
(75)

where

$$ K_{IJ} = K_{IJ}^{d} + K_{IJ}^{\beta } - \left( {K_{IJ}^{g} + \mathop {K_{IJ}^{g} }\nolimits^{\text{T}} } \right) $$
(76)
$$ F_{I} = F_{I}^{\text{b}} + F_{I}^{\text{t}} + F_{IJ}^{\beta } - F_{I}^{g} $$
(77)

in which the matrices and vectors in nodal integration are expressed as

$$ K_{IJ}^{d} = \int\limits_{\varOmega } {\varvec{B}_{I}^{\text{T}} \left( \varvec{x} \right)\varvec{DB}_{J} \left( \varvec{x} \right){\text{d}}\varOmega } \approx \mathop \sum \limits_{N = 1}^{\text{NP}} \varvec{B}_{I}^{\text{T}} \left( {\varvec{x}_{N} } \right)\varvec{DB}_{J} \left( {\varvec{x}_{N} } \right)A_{N} $$
(78)
$$ F_{I}^{\text{b}} = \int\limits_{\varOmega } {\varPsi_{I}^{\text{T}} \left( \varvec{x} \right)b\left( \varvec{x} \right){\text{d}}\varOmega } \approx \mathop \sum \limits_{N = 1}^{\text{NP}} \varPsi_{I}^{\text{T}} \left( {\varvec{x}_{N} } \right)b\left( {\varvec{x}_{N} } \right)A_{N} $$
(79)
$$ F_{I}^{\text{t}} = \int\limits_{{\partial \varOmega_{t} }} {\varPsi_{I}^{\text{T}} \left( \varvec{x} \right)t\left( \varvec{x} \right){\text{d}}\varGamma } \approx \mathop \sum \limits_{N = 1}^{{{\text{NP}}t}} \varPsi_{I}^{\text{T}} \left( {\varvec{x}_{N} } \right)t\left( {\varvec{x}_{N} } \right)L_{N} $$
(80)
$$ K_{IJ}^{\beta } = \beta \int\limits_{{\partial \varOmega_{g} }} {\varPsi_{I}^{\text{T}} \left( \varvec{x} \right)S\varPsi_{J} \left( \varvec{x} \right){\text{d}}\varGamma } \approx \beta \mathop \sum \limits_{N = 1}^{{{\text{NP}}g}} \varPsi_{I}^{\text{T}} \left( {\varvec{x}_{N} } \right)S\varPsi_{J} \left( {\varvec{x}_{N} } \right)L_{N} $$
(81)
$$ K_{IJ}^{g} = \int\limits_{{\partial \varOmega_{g} }} {\varvec{B}_{I}^{\text{T}} \left( \varvec{x} \right)\varvec{D\eta }S\varPsi_{J} \left( \varvec{x} \right){\text{d}}\varGamma } \approx \mathop \sum \limits_{N = 1}^{{{\text{NP}}g}} \varvec{B}_{I}^{\text{T}} \left( {\varvec{x}_{N} } \right)\varvec{D\eta }S\varPsi_{J} \left( {\varvec{x}_{N} } \right)L_{N} $$
(82)
$$ F_{IJ}^{\beta } = \beta \int\limits_{{\partial \varOmega_{g} }} {\varPsi_{I}^{\text{T}} \left( \varvec{x} \right)Sg{\text{d}}\varGamma } \approx \beta \mathop \sum \limits_{N = 1}^{{{\text{NP}}g}} \varPsi_{I}^{\text{T}} \left( {\varvec{x}_{N} } \right)SgL_{N} $$
(83)
$$ F_{I}^{g} = \int\limits_{{\partial \varOmega_{g} }} {\varvec{B}_{I}^{\text{T}} \left( \varvec{x} \right)\varvec{D\eta }Sg{\text{d}}\varGamma } \approx \mathop \sum \limits_{N = 1}^{{{\text{NP}}g}} \varvec{B}_{I}^{\text{T}} \left( {\varvec{x}_{N} } \right)\varvec{D\eta }SgL_{N} $$
(84)
$$ \varvec{B}_{I} \left( {\varvec{x}_{N} } \right) = \left[ {\begin{array}{*{20}l} {\varPsi_{I,1} \left( {\varvec{x}_{N} } \right)} \\ {\varPsi_{I,2} \left( {\varvec{x}_{N} } \right)} \\ \end{array} } \right], \varvec{D} = \left[ {\begin{array}{*{20}l} d & 0 \\ 0 & d \\ \end{array} } \right],\varvec{ \eta } = \left[ {\begin{array}{*{20}l} {n_{1} } \\ {n_{2} } \\ \end{array} } \right],\varvec{ }S = 1. $$
(85)

where \( \varvec{D} \) is the diffusivity tensor, \( d \) is the diffusion coefficient, and \( \varvec{\eta} \) is a collection of components of the surface unit normal on the boundary, and \( S = 1 \) is set for the convenience of keeping a unified coding structure in RKPM2D. Let us consider a diffusion problem [Eq. (74)] with a manufactured solution:

$$ u^{\text{exact}} = 0.1 + 0.1x_{1} + 0.2x_{2} $$
(86)

in a circular domain \( \varOmega \subset {\mathbb{R}}^{2} \) shown in Fig. 9 from Sect. 3.2. The flux \( t = 0.1n_{1} + 0.2n_{2} \) is imposed on \( \partial \varOmega_{t} :\left( {x_{1} ,x_{2} } \right) \in \partial \varOmega , \quad x_{2} > 0.5 \) where \( n_{1} {\text{ and }}n_{2} \) are the normal vector components. \( g = u^{\text{exact}} \) is enforced on \( \partial \varOmega_{g} :\left( {x_{1} ,x_{2} } \right) \in \partial \varOmega ,\quad x_{2} \le 0.5 \), and the body source is \( b = 0. \)

The input file for this problem is generated in the function getInput. Compared to Listing 1, the following changes need to be made:

  • Remove Model.nu and Model.Condition, as Poisson ratio and plane-stress/strain condition are not required for diffusion problem.

  • Replace Model.E with Model.d (i.e., change the definition of Young’s modulus \( E \) to be the diffusion coefficient \( d \)).

  • Replace Model.ElasticTensor with Model.DiffusiveTensor (i.e., change the definition of elastic tensor \( \varvec{C} \) to be the diffusive tensor \( \varvec{D} \)).

  • Set Model.DiffusiveTensor=diag([Model.d,Model.d])to define the diffusive tensor \( \varvec{D} = \left[ {\begin{array}{*{20}l} d & 0 \\ 0 & d \\ \end{array} } \right] \).

  • Set Model.DOFu=1 to change the nodal degrees of freedom DOFu from 2 to 1.

  • Set u_exact=0.1+0.1*x1+0.2*x2 to define the exact solution \( u^{\text{exact}} \).

In addition, we also need to modify the subroutine getBoundaryConditions to generate the exact boundary flux \( t =\varvec{\eta}^{\text{T}} \varvec{D}{\varvec{\nabla}} u^{\text{exact}} \), source term \( b = {\varvec{\nabla}} \cdot \left( {\varvec{D}{\varvec{\nabla}} u^{\text{exact}} } \right) \), essential boundary conditions \( g = u^{\text{exact}} \), and switch matrix \( S = 1 \) based on a given expression of the exact solution \( u^{\text{exact}} \) in a symbolic form, as shown in Listing 13.

figure z

Listing 13 shows command lines of function to generate exact heat flux \( t \), heat source \( b \), imposed scalar field \( g \), and switch matrix \( S \) for diffusion problems.

Due to the change of dimensionality in the \( \varvec{B} \) and \( \varvec{\varPsi} \) matrices compared to the elasticity problem, modifications are made to MatrixAssmebly (Listing 10) as follows

  • Set d=Model.d to define the diffusivity coefficient.

  • Set D=Model.DiffusiveTensor to define the diffusivity from input files.

  • Replace E with d (i.e., replace the Young’s modulus E with diffusion coefficient d).

  • Replace C with D (i.e., replace elastic tensor C with diffusive tensor D).

  • Set B=sparse(2,nP*DOFu).

  • Set PSI=sparse(1,nP*DOFu).

  • Modify the allocation of the B and PSI from shape function SHP and derivative SHPDX1, SHPDX2 as:

    • PSI=SHP(idx_nQuad,:);

    • B(1,:)=SHPDX1(idx_nQuad,:);

    • B(2,:)=SHPDX2(idx_nQuad,:);

  • Set ETA=[n1; n2;]to define the surface normal \( \varvec{\eta} \).

With the above-mentioned modifications, RKPM2D is converted to a program for solving diffusion problems. By comparing the original code for elasticity problems with the modified code for diffusion problems, one can see that only minimal code modifications are required. This capability of easy code extension is a unique feature of RKPM2D [37].

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Huang, TH., Wei, H., Chen, JS. et al. RKPM2D: an open-source implementation of nodally integrated reproducing kernel particle method for solving partial differential equations. Comp. Part. Mech. 7, 393–433 (2020). https://doi.org/10.1007/s40571-019-00272-x

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s40571-019-00272-x

Keywords

Navigation