Commit c31abd5b authored by Dorchies David's avatar Dorchies David
Browse files

Add Scilab scripts for testing #85 et #113

parent 5c0e04ac
function [res]= resolve_alpha(alpha,CdCh,R,U0,hstar,hp,C,D,Cd,ustar)
if bDbg then
if bDbg_RA then
printf('resolve_alpha(alpha=%f,CdCh=%f,R=%f,U0=%f,hstar=%f,hp=%f,C=%f,D=%f,Cd=%f,ustar=%f)\n',alpha,CdCh,R,U0,hstar,hp,C,D,Cd,ustar)
end
g=9.81;
......@@ -43,7 +43,7 @@ Uh=UhU0*U0;
res=abs(alpha*Uh-L1*ustar);
if bDbg then
if bDbg_RA then
printf('resolve_alpha res=%f\n',res)
end
......
function macrorugo_searchQ(ks, D, k, Cd0, S, B, h, C, z_amont, long, bDbg)
printf("ks=%f\n", ks)
printf("D=%f\n", D)
printf("k=%f\n", k)
printf("Cd0=%f\n", Cd0)
printf("S=%f\n", S)
printf("B=%f\n", B)
printf("h=%f\n", h)
printf("C=%f\n", C)
printf("*** INPUT *** \n")
print_r("ks")
print_r("D")
printf("k = %f\n", k)
print_r("Cd0")
print_r("S")
print_r("B")
print_r("h")
print_r("C")
maxfun=5000;
maxiter=5000;
......@@ -20,9 +21,11 @@ function macrorugo_searchQ(ks, D, k, Cd0, S, B, h, C, z_amont, long, bDbg)
g=9.81
N=0;
q0=(2*g.*S.*D.*(1-(sigma*C))/(Cd0.*C.*(1+N))).^0.5*h*B;
fVal = find_Q_nat(q0,ks,D,k,Cd0,S,B,h,C,sigma,%t);
fVal = find_Q_nat(q0,ks,D,k,Cd0,S,B,h,C,sigma,bDbg);
printf("RESULTS:\n")
printf("find_Q_nat(%f)=%f\n",q0,fVal);
[Q fVal, exitflag, outputs] = fminsearch(list(find_Q_nat, ks,D,k,Cd0,S,B,h,C,sigma,bDbg), q0, opt);
printf("Q=%f fVal=%f\n",Q, fVal);
macrorugo_resultComp(z_amont, S, long, Q, B, h, C, Cd0, k, D)
printf("\n");
endfunction
......@@ -4,6 +4,7 @@ sCurrentPath = get_absolute_file_path("main_macrorugo.sce");
getd(sCurrentPath);
bDbg = %f;
bDbg_RA = %f;
// Tests parameters
ks = 0.01 // Rugosité de fond (m)
......@@ -37,5 +38,17 @@ printf("\n*** Submerged conditions ***\n")
k = 0.7
h = 0.8
Cd0 = 1.5
C = 0.13
macrorugo_searchQ(ks, D, k, Cd0, S, B, h, C, z_amont, long, bDbg)
// *****************************************************************************
printf("\n*** JalHyd #85 ***\n")
// *****************************************************************************
k = 0.8
C = 0.2; // Concentration
for h = 0.7:0.1:1.2
macrorugo_searchQ(ks, D, k, Cd0, S, B, h, C, z_amont, long, bDbg)
end
macrorugo_searchQ(ks, D, 0.5, 2, S, 2, 0.85, C, z_amont, long, bDbg)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment