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
Calculate right hand side of the differential equation : dx/dt = F(x,t) F is discribed in Hutter 1993. |
|
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) – |
|
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 |
|
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 |
|
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 |
|
get flow thickness 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 |
|
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 |
|
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 |
|
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 |
|
Define earth pressure coefficients |
|
Define release thickness for the similarity solution test |
|
get flow thickness, flow velocity and center location of flow mass of similarity solution for required time step |
|
Compute similarity solution :Parameters: simiSolCfg (pathlib path) – path to simiSol configuration file |
|
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) – |
|
loop on all DFA simulations and compare then to the anlytic solution |
|
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 |