Skip to content
Snippets Groups Projects

Added central moments functionality to lbmpy

Closed Jonas Plewinski requested to merge central_moments into master
3 unresolved threads

This merge request will add central moment functionality to lbmpy (shift_matrix, get_central_moments). Remaining TODOs:

  • The Demo notebook can not be executed at the moment since the includes are not correct.
  • Integrate central moments fully into lbmpy. This means something like this should be possible create_lb_method(..., central_moments=True).
  • Unit tests for the get_shift_matrix function.
  • Physical test case the central moments.
Edited by Jonas Plewinski

Merge request reports

Pipeline #28246 waiting for manual action

Pipeline waiting for manual action for fec19283 on central_moments

Test coverage 89.89% (-0.23%) from 1 job
Approval is optional

Closed by Markus HolzerMarkus Holzer 4 years ago (Jan 26, 2021 6:57am UTC)

Merge details

  • The changes were not merged into master.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
368 369 return sp.Matrix(len(moments), len(stencil), generator)
369 370
370 371
372 def shift_matrix(moments, stencil):
373 """
374 Returns shift matrix to shift raw moments to central moment space
375 """
376 x, y, z = MOMENT_SYMBOLS
377 dim = len(stencil[0])
378 nr_directions = len(stencil)
379
380 directions = asarray(stencil)
381
382 u = sp.symbols("u_:{dim}".format(dim=dim))
  • added 1 commit

    • a8707c7c - resolved errors in demo notebook and integrated unittest for shift_matrix

    Compare with previous version

  • Jonas Plewinski marked the checklist item The Demo notebook can not be executed at the moment since the includes are not correct. as completed

    marked the checklist item The Demo notebook can not be executed at the moment since the includes are not correct. as completed

  • Jonas Plewinski marked the checklist item Unit tests for the get_shift_matrix function. as completed

    marked the checklist item Unit tests for the get_shift_matrix function. as completed

  • added 1 commit

    • b92676d3 - Added function get_central_moments to moments.py

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    • 45d2d7e2 - Added central moments to documentation

    Compare with previous version

  • Markus Holzer added 1 commit

    added 1 commit

    • fec19283 - Implemented CM in momentbased.py

    Compare with previous version

  • 368 369 return sp.Matrix(len(moments), len(stencil), generator)
    369 370
    370 371
    372 def set_up_shift_matrix(moments, stencil):
    373 """
    374 Sets up a shift matrix to shift raw moments to central moment space
    375 """
    376 x, y, z = MOMENT_SYMBOLS
    377 dim = len(stencil[0])
    378 nr_directions = len(stencil)
    379
    380 directions = asarray(stencil)
    381
    382 u = sp.symbols(f"u_:{dim}")
    • Could we have u not hard-coded, but as a parameter to this function? Might be useful in situations where velocity symbols are provided otherwise, potentially with other names, or even by more complex expressions (like such including the half-force shift).

    • Please register or sign in to reply
  • 368 369 return sp.Matrix(len(moments), len(stencil), generator)
    369 370
    370 371
    372 def set_up_shift_matrix(moments, stencil):
    • Can we add the possibility to pass a list of exponent tuples to the moments parameter? For this case, lines 390 and 392 wouldn't be necessary, and a caller wouldn't have to convert exponent tuples to polynomials first. Of course, the ability to pass polynomials should be kept.

      Edited by Frederik Hennig
    • Please register or sign in to reply
  • closed

  • Please register or sign in to reply
    Loading