ana1Tests.simiSolTest

Similarity solution module

This module contains functions that compute the similarity solution for a gliding avalanche on a inclined plane according to similarity solution from : Hutter, K., Siegel, M., Savage, S.B. et al. Two-dimensional spreading of a granular avalanche down an inclined plane Part I. theory. Acta Mechanica 100, 37–68 (1993). https://doi.org/10.1007/BF01176861

Functions

Ffunction

Calculate right hand side of the differential equation : dx/dt = F(x,t) F is discribed in Hutter 1993.

analyzeResults

Compare analytical and com1DFA results :Parameters: * avalancheDir (pathlib path) – path to avalanche directory * fieldsList (list) – list of fields dictionaries * timeList (list) – list of time steps * solSimi (dictionary) –

calcEarlySol

Compute the early solution for 0<t<t_1 to avoid singularity in the Runge-Kutta integration process :Parameters: * t (numpy array) – time array * earthPressureCoefficients (numpy array) – earth Pressure Coefficients * x_0 (numpy array) – initial condition * zeta (float) – slope angle * delta (float) – friction angle * eps_x (float) – scale in x dir * eps_y (float) – scale in y dir

computeEarthPressCoeff

Computes the earth pressure coefficients function of sng of f and g i.e depending on if we are in the active or passive case

computeFCoeff

Compute coefficients eq 3.2 for the function F :Parameters: * K_x (float) – Kx earth pressure coef * K_y (float) – Ky earth pressure coef * zeta (float) – slope angle * delta (float) – friction angle * eps_x (float) – scale in x dir * eps_y (float) – scale in y dir

computeH

get flow depth from f and g solutions :Parameters: * solSimi (dictionary) – similarity solution * x1 (numpy array) – x coordinate location desiered for the solution * y1 (numpy array) – y coordinate location desiered for the solution * i (int) – time index * L_x (float) – scale in x dir * L_y (float) – scale in y dir * H (float) – scale in z dir * AminusC – A-C coefficient

computeU

get flow velocity in x direction from f and g solutions :Parameters: * solSimi (dictionary) – similarity solution * x1 (numpy array) – x coordinate location desiered for the solution * y1 (numpy array) – y coordinate location desiered for the solution * i (int) – time index * L_x (float) – scale in x dir * U (float) – x velocity component scale * AminusC – A-C coefficient

computeV

get flow velocity in y direction from f and g solutions :Parameters: * solSimi (dictionary) – similarity solution * x1 (numpy array) – x coordinate location desiered for the solution * y1 (numpy array) – y coordinate location desiered for the solution * i (int) – time index * L_y (float) – scale in y dir * V (float) – y velocity component scale

computeXC

get center of mass location :Parameters: * solSimi (dictionary) – similarity solution * x1 (numpy array) – x coordinate location desiered for the solution * y1 (numpy array) – y coordinate location desiered for the solution * i (int) – time index * L_x (float) – scale in x dir * AminusC – A-C coefficient

defineEarthPressCoeff

Define earth pressure coefficients

getReleaseThickness

Define release thickness for the similarity solution test

getSimiSolParameters

get flow depth, flow velocity and center location of flow mass of similarity solution for required time step

mainSimilaritySol

Compute similarity solution :Parameters: simiSolCfg (pathlib path) – path to simiSol configuration file

odeSolver

Solve the ODE using a Runge-Kutta method :Parameters: * solver (ode instance) – ode instance corresponding to out ODE * dt (float) – time step * t_end (float) – end time * solSimi (dictionary) –

postProcessSimiSol

loop on all DFA simulations and compare then to the anlytic solution

prepareParticlesFieldscom1DFA

get fields and particles dictionaries for given time step, for com1DFA domain origin is set to 0,0 for particles - so info on domain is required