Skip to content

[com1]: option to delete stopped particles, and adapt surface according to deposition & erosion#1112

Merged
fso42 merged 2 commits intomasterfrom
PS_adaptiveDEM
Jul 7, 2025
Merged

[com1]: option to delete stopped particles, and adapt surface according to deposition & erosion#1112
fso42 merged 2 commits intomasterfrom
PS_adaptiveDEM

Conversation

@PaulaSp3
Copy link
Copy Markdown
Contributor

@PaulaSp3 PaulaSp3 commented Mar 27, 2025

  • option (flag delStoppedParticles) that particles with mass = 0 or velocity = 0 are deleted

  • option that surface according to entrainment (adaptSfcEntrainment), detrainment (adaptSfcDetrainment) and/or stopping (adaptSfcStopped) is adapted in every time step

  • now the surface is only adapted if in one raster cell the height change is > 0.1 m (can/should be adapated)

  • check normals:

  • avaKot (entres):
    -- normalized normals (z-component) (= cos(theta)) do not change (relatively) by more than 1.5% (from one time step to another) (except in the last time step)
    -- theta (slope) does not change by more than (absolut) (except in the last time step)
    -- theta (slope) changes by more than 10% (relatively), but only in areas where there is stopping (and in flat terrain) (except in the last time step)

e.g. time step 94.5 s (it has the maximal change (in one cell) of the slope angle from one timestep to another)
avaKot, entres simulation with detrainment (in whole resistance area, detK = 20), explicitFriction = 1, delStoppedParticles = 1, adaptSfcStopped = 1, adaptSfcDetrainment = 1, adaptSfcEntrainment = 1

pfv (in whole domain)
Screenshot from 2025-06-05 10-02-59

zoom to slope angle change (slope angle(t=94.5) - slope angle(t=94.4)):

Screenshot from 2025-06-05 10-04-21

zoom to depth change (that is added to surface in t=94.5):

Screenshot from 2025-06-05 10-04-12

  • avaKot (ent; adaptSfcStopped = 0, adaptSfcEntrainment = 1): maximal slope angle change (per cell from one timestep to another): 0.079°

  • avaMal (ent; adaptSfcStopped = 0, adaptSfcEntrainment = 1)): maximal slope angle change (per cell from one timestep to another): 0.6° (at time step 39.7)

pfv (in whole domain)
Screenshot from 2025-06-05 13-19-07

zoom to slope angle change (slope angle(t=39.7) - slope angle(t=39.6)):

Screenshot from 2025-06-05 13-19-36

zoom to depth change (that is added to surface in t=39.7):

Screenshot from 2025-06-05 13-19-29

  • avaParabola (res):
    -- normalized normals (z-component) (= cos(theta)) do not change (relatively) by more than 1.5% (from one time step to another) (except in the last time step)
    -- theta (slope) does not change by more than (absolut) (except in the last time step)
    -- theta changes by more than (absolut): due to stopping
    -- theta (slope) changes by more than 10% (relatively), but only in areas where there is stopping (and in flat terrain) (except in the last time step)

changed computation time due to adapting surface: (explicitFriction = 1, delStoppedParticles = 1, adaptSfcStopped = 1, adaptSfcDetrainment = 1, adaptSfcEntrainment = 1)

  • avaKot (entres sim):+ 84%
  • avaParabola (null and res sim): + 152%
  • avaMal (null and ent sim): + 2%

adapted docu is in progress...

some further ideas/ thoughts/ issues: #1113

@PaulaSp3 PaulaSp3 added enhancement New feature or request com1DFAdev labels Mar 27, 2025
@PaulaSp3 PaulaSp3 requested review from awirb and fso42 March 27, 2025 10:52
@qltysh
Copy link
Copy Markdown
Contributor

qltysh bot commented Mar 27, 2025

3 new issues

Tool Category Rule Count
qlty Structure Deeply nested control flow (level = 4) 2
qlty Duplication Found 20 lines of similar code in 2 locations (mass = 76) 1

@qltysh
Copy link
Copy Markdown
Contributor

qltysh bot commented Mar 27, 2025

Diff Coverage: The code coverage on the diff in this pull request is 68.6%.

Total Coverage: This PR will increase coverage by 0.13%.

File Coverage Changes
Path File Coverage Δ Indirect
avaframe/com1DFA/checkCfg.py 1.2
avaframe/com1DFA/com1DFA.py 0.2
avaframe/com1DFA/com1DFATools.py -0.8
avaframe/com1DFA/particleTools.py 0.5
avaframe/out3Plot/plotUtils.py 0.1
🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@fso42 fso42 added this to the Version 1.13 milestone Mar 27, 2025
@PaulaSp3 PaulaSp3 force-pushed the PS_adaptiveDEM branch 2 times, most recently from 95dd9f4 to 7eff7ae Compare March 27, 2025 16:30
@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit a6468d0 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

The test coverage on the diff in this pull request is 89.8% (50% is the threshold).

This pull request will bring the total coverage in the repository to 70.3% (0.2% change).

View more on Code Climate.

@PaulaSp3 PaulaSp3 force-pushed the PS_adaptiveDEM branch 2 times, most recently from 829c7a3 to 4b9fe18 Compare May 26, 2025 12:37
Copy link
Copy Markdown
Contributor

@fso42 fso42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only one last comment...

@PaulaSp3 PaulaSp3 unassigned fso42 and awirb Jun 3, 2025
@PaulaSp3 PaulaSp3 requested a review from fso42 June 4, 2025 13:15
@PaulaSp3 PaulaSp3 force-pushed the PS_adaptiveDEM branch 3 times, most recently from 1b9da7f to f462ffa Compare June 5, 2025 13:58
@PaulaSp3 PaulaSp3 force-pushed the PS_adaptiveDEM branch 4 times, most recently from 3680819 to a67bab8 Compare June 30, 2025 12:54
@fso42 fso42 assigned fso42 and unassigned PaulaSp3 Jul 7, 2025
compute hDep and hEro per time step

adapt DEM with Erosion and Deposition

deposit partciles

use function to delete particles

minor

minor

consider deposited particles in demAdapted

adapt DEM from deposition and detrainment

fixed bugs

write stopped mass in MB file§

move computation for erosion thickness to upateFields

fix bug and to create report pngs for thenew outputs

compute normalized vectors of every topography makes avalanche not flowing downwards

minor

now deposition and adaptive topo works!

tidy up

flags for adapt sfc and delete stopped particles; separate stopping + detrainment

fix adapt dem

separate in stopping, detrainment and entrainment

minor changes

flag to choose if original or adapted DEM is background in report plots

adapt and write tests for adaptive topography

check if parameter methodmeshnormal has a plausible value

adapt variable names to consistent wording

array computing

delete not used variables

first doc

fix bug: add  change of depth to DEM instead of thickness

adapt test for computation with depth

fix bug

test normals

for testing normals

comments

test

still error!

tidy up

minor change

chnage output files

minor improvements

peakfile hDetrained etc is summed up over all timesteps

comments Felix

comments Felix

adapt test

move function to choose plot-DEM

merge detrained, entrained, stopped depth change to sfcChange

adapt ouput name

adapt test

adapt test

fix bug in MB file, adapt test

fix errors in test

fix error

fix error

comments AW

threshold to chnage surface in ini

simplify adaptDem function

adapt test for simplified adapt Dem function
@fso42 fso42 force-pushed the PS_adaptiveDEM branch from e9813ff to 6924ef2 Compare July 7, 2025 08:06
@fso42
Copy link
Copy Markdown
Contributor

fso42 commented Jul 7, 2025

Standardtest ok, apart from know res

@fso42 fso42 merged commit 3ea47bd into master Jul 7, 2025
5 checks passed
@fso42 fso42 deleted the PS_adaptiveDEM branch July 7, 2025 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DebrisFrame enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants