Repository navigation
[com1DFA] Add TJEM entrainment model - #1339
Open
Michael-Pallua wants to merge 8 commits into
Open
Michael-Pallua wants to merge 8 commits into
Michael-Pallua wants to merge 8 commits into
Conversation
Contributor
fso42
requested changes
Oct 12, 2026
| if entrType == 1: | ||
| dm, areaEntrPart = computeEntMassAndForce(dt, entrMassCell, areaPart, uMag, tau, entEroEnergy, rhoEnt) | ||
| if entrType == 2: | ||
| dm, areaEntrPart, tau = computeEntMassAndForceTjem(dt, entrMassCell, areaPart, uMag, tau, entShearStrength, rhoEnt) |
Contributor
There was a problem hiding this comment.
The changed tau has no effect! Tau is last used 19 lines up and not used anymore afterwards. So either drop the value and remove the code, or compute this here earlier in the code
| # in contrast to MoTVoellmy tau_c here is not scaled with the flow density | ||
| # because com1DFA does not scale shear stress at the bottom of the avalanche with the flow density while MoTVoellmy does | ||
| tau_c = entShearStrength | ||
| dm = max(0, tau - tau_c) * areaPart * dt / uMag |
Contributor
There was a problem hiding this comment.
for resting particles uMag is 0 -> so you get a divide by 0! So protect with velMagMin (similar to friction code) and also cap dm by teh pass available in the cell
| entrModel = cfgGen["entrModel"].lower() | ||
| entrType = entrModelsList.index(entrModel) + 1 | ||
| log.debug("Entrainment Model used: %s, %s" % (entrModelsList[entrType - 1], entrType)) | ||
| print("Entrainment Model used: %s, %s" % (entrModelsList[entrType - 1], entrType)) |
|
|
||
| #++++++++++++ Entrainment Model | ||
| ### Available Models: | ||
| #avaframe |
| # erosion: erode according to shear strength of snow cover | ||
| # in contrast to MoTVoellmy tau_c here is not scaled with the flow density | ||
| # because com1DFA does not scale shear stress at the bottom of the avalanche with the flow density while MoTVoellmy does | ||
| tau_c = entShearStrength |
| rhoEnt: float | ||
| entrainement density | ||
| """ | ||
| cdef double width, ABotSwiped |
|
|
||
| return dm, areaEntrPart | ||
|
|
||
| cpdef (double, double, double) computeEntMassAndForceTjem(double dt, double entrMassCell, |
Contributor
There was a problem hiding this comment.
rhoEnt is passed, but never used
| # in contrast to MoTVoellmy tau_c here is not scaled with the flow density | ||
| # because com1DFA does not scale shear stress at the bottom of the avalanche with the flow density while MoTVoellmy does | ||
| tau_c = entShearStrength | ||
| dm = max(0, tau - tau_c) * areaPart * dt / uMag |
Contributor
There was a problem hiding this comment.
use max (0.0, ...) -> with double instead of int
|
|
||
| #++++++++++++ Entrainment Erosion Energy | ||
| # Used to determine speed loss via energy loss due to entrained mass | ||
| # Used to determine speed loss via energy loss due to entrained mass when using Avaframe Entrainment Model |
| entEroEnergy = 5000 | ||
|
|
||
| #++++++++++++ Entrainment Shear Strength | ||
| # Used to determine the strength of the erodible snow cover when using TJEM Entrainment Model |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The goal is to make the TJEM entrainment model, which is already present in
com9MoTVoellmy, available incom1DFA.Short description of changed files:
com1DFACfg.ini:A parameter to select the desired entrainment model (etnrType) is included as well as the parameter of the new entrainment model: the shear strength of the erodible snow cover (entShearStrength).
com1DFA.py:Changes are made to implement the new selection between the two now available entrainment models.
DFAfunctionsCython.pyxandDFAfunctionsCython.pxdA new function,
computeEntMassAndForceTjem(), which implements the equations of the TJEM entrainment model is added.PR Checklist
Please confirm before requesting review:
pytestlocally without failsConfirm before the final merge/rebase into master