Skip to content

Commit

Permalink
Working to be able to dynamically add fibers
Browse files Browse the repository at this point in the history
  • Loading branch information
schrummy14 committed Aug 17, 2020
1 parent f199225 commit 681e04c
Show file tree
Hide file tree
Showing 21 changed files with 2,356 additions and 74 deletions.
Expand Up @@ -215,12 +215,12 @@ def getProps(data):
X2 = df[["frq","bgd"]] # X = df[["frq","bgd"]]
y = df["bld"]

md1 = fitlm(X1,y,"quadratic")
# md1 = fitlm(X1,y,"quadratic")
# print(md1.summary())
md2 = fitlm(X2,y,"interactions")
# print(md2.summary())
print(md2.summary())

sLM = stepwiselm(X2,y)
sLM = stepwiselm(X2,y,'interactions')
print(sLM.summary())

# plt.plot(bld,bgd,'o')
Expand Down
Expand Up @@ -37,7 +37,7 @@ variable r3 equal ${r2}*${particle_radius}
variable K equal ${bond_youngs_mod_max}*PI*${r2}/${bond_length}
variable m equal 4.0*PI*${r3}*${particle_density}/3.0
variable w equal sqrt($K/$m)
variable dt equal 0.95/((1.1+2.9*${bond_damp_val_max})*$w)
variable dt equal 1.0e-7 # 0.95/((1.1+2.9*${bond_damp_val_max})*$w)

### Simulation Dependent Parameters
variable time_to_deflect equal (${deflection_distance}+0.5*${particle_diameter})/${deflection_speed}
Expand Down Expand Up @@ -99,7 +99,7 @@ neigh_modify delay 0 # Update neighbors whenever we need to
pair_coeff * *

# Bond coefficients (Bond type) (Outside Bond ) (Inside Bond) (Bond_Y) (Bond_G) (Bond_Damp_Type) (Bond_Damp) (Bond_Break_Type) (Crit_Norm) (Crit_Tan)
bond_coeff 1 ${bond_out_per} ${bond_in_per} ${bond_youngs_modulus} ${bond_shear_modulus} ${bond_damp_type} ${bond_damp_val} 1 1.0e32 1.0e32
bond_coeff 1 ${bond_out_per} ${bond_in_per} ${bond_youngs_modulus} ${bond_shear_modulus} 6 0.0 ${bond_damp_val} 0.0 1 1.0e32 1.0e32

# Material Properties
fix m1 all property/global youngsModulus peratomtype ${contact_youngs_modulus}
Expand Down Expand Up @@ -129,7 +129,7 @@ variable sim_time equal step*${dt}
variable px equal x[${lastone}]
variable pz equal z[${lastone}]
variable vz equal vz[${lastone}]
thermo_style custom step atoms numbond v_sim_time cpu cpuremain v_pz v_vz ke
thermo_style custom step atoms numbonds v_sim_time cpu cpuremain v_pz v_vz ke
thermo ${thermo_step}
thermo_modify lost ignore norm no

Expand Down
Expand Up @@ -45,10 +45,10 @@ def readDOEparams(fileName = "DOE_Params.txt"):


if __name__ == "__main__":
N_bond_damp_vals = 4
N_bond_Youngs_modulus = 4
N_bond_damp_vals = 5
N_bond_Youngs_modulus = 5

bond_damp_vals = linspace(0,10,N_bond_damp_vals)
bond_damp_vals = linspace(0,0.002,N_bond_damp_vals)
bond_Youngs_modulus_vals = linspace(1e9,1e10,N_bond_Youngs_modulus)

variable_names = [
Expand All @@ -61,4 +61,4 @@ def readDOEparams(fileName = "DOE_Params.txt"):

make_DOE_txt(variable_names,[bvs.flatten(),bYms.flatten()], "DOE_Params.txt")

print(readDOEparams())
print(readDOEparams())
Expand Up @@ -20,16 +20,18 @@
plot(x(1:id_max),f(1:id_max),x(id_max+1:end),f(id_max+1:end))
xlabel ('Displacement (mm)')
ylabel ('Force (N)')
legend ('Compression','Release','Location','NW')
% legend ('Compression','Release','Location','NW')
legend('Compression', 'Release')
title 'Raw Data'

%% Smooth the data a litte
f = medfilt1(f,15);
%f = medfilt1(f,15);
figure
plot(x(1:id_max),f(1:id_max),x(id_max+1:end),f(id_max+1:end))
xlabel ('Displacement (mm)')
ylabel ('Force (N)')
legend ('Compression','Release','Location','NW')
% legend ('Compression','Release','Location','NW')
legend('Compression','Release')
title 'Smoothed Data'

%% Find linear portion of the curve
Expand Down Expand Up @@ -66,4 +68,5 @@
end

figure
plot(x_new,f_new,'k-',x_new,f_prime,'r--')
plot(x_new,f_new,'k-',x_new,f_prime,'r--')
pause
Expand Up @@ -6,7 +6,7 @@ variable particle_diameter equal 2.83e-3 # meters
variable bond_out_diameter equal 2.83e-3 # meters
variable bond_in_diameter equal 0.0 # meters
variable bond_damp_type equal 1 # Use Yu Guo Damping
variable bond_damp_val equal 50.0 # NA
variable bond_damp_val equal 1.0 # NA
variable particle_density equal 420.0 # kg/m3
variable contact_youngs_modulus equal 1.0e9 # Pa
variable bond_youngs_modulus equal 1.0e9 # Pa
Expand All @@ -16,10 +16,10 @@ variable particle_poissons_ratio equal 0.3 # NA
variable deflection_distance equal 20.0e-3 # distance to deflect the straw
variable deflection_speed equal 1.0 # the speed of the deflection (m/s)
variable wait_time equal 25.0e-3 # time we wait for the beam to settle in seconds
variable vibrate_time equal 0.125 # time we let the beam vibrate in seconds
variable vibrate_time equal 0.25 # time we let the beam vibrate in seconds
variable fileprint_time equal 1.0e-3 # how often we print to the file in seconds
variable thermo_time equal 1.0e-4 # how often we print to the screen in seconds
variable output_time equal 5.0e-5 # how often we print to beam.csv in seconds
variable thermo_time equal 1.0e-3 # how often we print to the screen in seconds
variable output_time equal 5.0e-3 # how often we print to beam.csv in seconds

### Material Dependent Properties
variable particle_radius equal 0.5*${particle_diameter}
Expand Down Expand Up @@ -94,7 +94,8 @@ neigh_modify delay 0 # Update neighbors whenever we need to
pair_coeff * *

# Bond coefficients (Bond type) (Outside Bond ) (Inside Bond) (Bond_Y) (Bond_G) (Bond_Damp_Type) (Bond_Damp) (Bond_Break_Type) (Crit_Norm) (Crit_Tan)
bond_coeff 1 ${bond_out_per} ${bond_in_per} ${bond_youngs_modulus} ${bond_shear_modulus} ${bond_damp_type} ${bond_damp_val} 1 1.0e32 1.0e32
# bond_coeff 1 ${bond_out_per} ${bond_in_per} ${bond_youngs_modulus} ${bond_shear_modulus} ${bond_damp_type} ${bond_damp_val} 1 1.0e32 1.0e32
bond_coeff 1 ${bond_out_per} ${bond_in_per} ${bond_youngs_modulus} ${bond_shear_modulus} 5 0.0 0.05 0.0 1 1.0e16 1.0e16

# Material Properties
fix m1 all property/global youngsModulus peratomtype ${contact_youngs_modulus}
Expand Down
Expand Up @@ -99,7 +99,7 @@ fix BotShear all mesh/surface/stress file STL/ShearBox_TopPlate.STL type 2 &

# Top plate has a mass of 401 grams
fix TopShear all mesh/surface/stress/servo file STL/ShearBox_TopPlate.STL type 2 &
scale 0.001 rotate axis 1 0 0 angle 180 move 0.0 0.1015 0.080 &
scale 0.001 rotate axis 1 0 0 angle 180 move 0.0 0.1015 0.090 &
curvature_tolerant yes com 0.05 0.05 0.08 ctrlPV force &
axis 0.0 0.0 -1.0 target_val ${shear_force} vel_max 5.0 &
kp 5.0e-2 ki 0.0 kd 0.0
Expand Down Expand Up @@ -133,17 +133,17 @@ fix pts1 all particletemplate/multiplespheres 15485863 atom_type 1 &
0.0025 0.0 0.0 0.00125 &
0.0050 0.0 0.0 0.00125 &
0.0075 0.0 0.0 0.00125 &
bonded yes
bonded no

# Set the distribution of particles
fix pdd1 all particledistribution/discrete 32452843 1 pts1 1.0

# Create a region to insert the particles
region fill_box block 0.0 0.1015 0.0 0.1015 0.0065 0.0735 units box
region fill_box block 0.0 0.1015 0.0 0.1015 0.0065 0.0835 units box

# Particle insertion
fix ins all insert/pack seed 32452867 distributiontemplate pdd1 &
maxattempt 500 insert_every once overlapcheck yes orientation random &
maxattempt 50000 insert_every once overlapcheck yes orientation random &
all_in yes vel constant 0.0 0.0 -0.0 region fill_box &
particles_in_region 5000 ntry_mc 10000 check_dist_from_subdomain_border no

Expand Down
@@ -0,0 +1,226 @@
solid ShearBox_BottomHalf
facet normal 0.000000e+000 0.000000e+000 1.000000e+000
outer loop
vertex 0.000000e+000 1.016000e+002 2.450000e+001
vertex -1.900000e+001 1.206000e+002 2.450000e+001
vertex 0.000000e+000 0.000000e+000 2.450000e+001
endloop
endfacet
facet normal 0.000000e+000 0.000000e+000 1.000000e+000
outer loop
vertex 0.000000e+000 0.000000e+000 2.450000e+001
vertex -1.900000e+001 1.206000e+002 2.450000e+001
vertex -1.900000e+001 -1.900000e+001 2.450000e+001
endloop
endfacet
facet normal 0.000000e+000 0.000000e+000 1.000000e+000
outer loop
vertex 0.000000e+000 0.000000e+000 2.450000e+001
vertex -1.900000e+001 -1.900000e+001 2.450000e+001
vertex 1.016000e+002 0.000000e+000 2.450000e+001
endloop
endfacet
facet normal 0.000000e+000 0.000000e+000 1.000000e+000
outer loop
vertex 1.016000e+002 0.000000e+000 2.450000e+001
vertex -1.900000e+001 -1.900000e+001 2.450000e+001
vertex 1.206000e+002 -1.900000e+001 2.450000e+001
endloop
endfacet
facet normal 0.000000e+000 0.000000e+000 1.000000e+000
outer loop
vertex 1.016000e+002 0.000000e+000 2.450000e+001
vertex 1.206000e+002 -1.900000e+001 2.450000e+001
vertex 1.016000e+002 1.016000e+002 2.450000e+001
endloop
endfacet
facet normal 0.000000e+000 0.000000e+000 1.000000e+000
outer loop
vertex 1.016000e+002 1.016000e+002 2.450000e+001
vertex 1.206000e+002 -1.900000e+001 2.450000e+001
vertex 1.206000e+002 1.206000e+002 2.450000e+001
endloop
endfacet
facet normal 0.000000e+000 0.000000e+000 1.000000e+000
outer loop
vertex 1.016000e+002 1.016000e+002 2.450000e+001
vertex 1.206000e+002 1.206000e+002 2.450000e+001
vertex 0.000000e+000 1.016000e+002 2.450000e+001
endloop
endfacet
facet normal 0.000000e+000 0.000000e+000 1.000000e+000
outer loop
vertex 0.000000e+000 1.016000e+002 2.450000e+001
vertex 1.206000e+002 1.206000e+002 2.450000e+001
vertex -1.900000e+001 1.206000e+002 2.450000e+001
endloop
endfacet
facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
outer loop
vertex 0.000000e+000 1.016000e+002 0.000000e+000
vertex -1.900000e+001 1.206000e+002 0.000000e+000
vertex 1.016000e+002 1.016000e+002 0.000000e+000
endloop
endfacet
facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
outer loop
vertex 1.016000e+002 1.016000e+002 0.000000e+000
vertex -1.900000e+001 1.206000e+002 0.000000e+000
vertex 1.206000e+002 1.206000e+002 0.000000e+000
endloop
endfacet
facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
outer loop
vertex 1.016000e+002 1.016000e+002 0.000000e+000
vertex 1.206000e+002 1.206000e+002 0.000000e+000
vertex 1.016000e+002 0.000000e+000 0.000000e+000
endloop
endfacet
facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
outer loop
vertex 1.016000e+002 0.000000e+000 0.000000e+000
vertex 1.206000e+002 1.206000e+002 0.000000e+000
vertex 1.206000e+002 -1.900000e+001 0.000000e+000
endloop
endfacet
facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
outer loop
vertex 1.016000e+002 0.000000e+000 0.000000e+000
vertex 1.206000e+002 -1.900000e+001 0.000000e+000
vertex 0.000000e+000 0.000000e+000 0.000000e+000
endloop
endfacet
facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
outer loop
vertex 0.000000e+000 0.000000e+000 0.000000e+000
vertex 1.206000e+002 -1.900000e+001 0.000000e+000
vertex -1.900000e+001 -1.900000e+001 0.000000e+000
endloop
endfacet
facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
outer loop
vertex 0.000000e+000 0.000000e+000 0.000000e+000
vertex -1.900000e+001 -1.900000e+001 0.000000e+000
vertex 0.000000e+000 1.016000e+002 0.000000e+000
endloop
endfacet
facet normal 0.000000e+000 0.000000e+000 -1.000000e+000
outer loop
vertex 0.000000e+000 1.016000e+002 0.000000e+000
vertex -1.900000e+001 -1.900000e+001 0.000000e+000
vertex -1.900000e+001 1.206000e+002 0.000000e+000
endloop
endfacet
facet normal -1.000000e+000 0.000000e+000 0.000000e+000
outer loop
vertex -1.900000e+001 -1.900000e+001 2.450000e+001
vertex -1.900000e+001 1.206000e+002 2.450000e+001
vertex -1.900000e+001 -1.900000e+001 0.000000e+000
endloop
endfacet
facet normal -1.000000e+000 0.000000e+000 0.000000e+000
outer loop
vertex -1.900000e+001 -1.900000e+001 0.000000e+000
vertex -1.900000e+001 1.206000e+002 2.450000e+001
vertex -1.900000e+001 1.206000e+002 0.000000e+000
endloop
endfacet
facet normal 0.000000e+000 -1.000000e+000 0.000000e+000
outer loop
vertex 1.206000e+002 -1.900000e+001 2.450000e+001
vertex -1.900000e+001 -1.900000e+001 2.450000e+001
vertex 1.206000e+002 -1.900000e+001 0.000000e+000
endloop
endfacet
facet normal 0.000000e+000 -1.000000e+000 0.000000e+000
outer loop
vertex 1.206000e+002 -1.900000e+001 0.000000e+000
vertex -1.900000e+001 -1.900000e+001 2.450000e+001
vertex -1.900000e+001 -1.900000e+001 0.000000e+000
endloop
endfacet
facet normal 1.000000e+000 0.000000e+000 0.000000e+000
outer loop
vertex 1.206000e+002 1.206000e+002 2.450000e+001
vertex 1.206000e+002 -1.900000e+001 2.450000e+001
vertex 1.206000e+002 1.206000e+002 0.000000e+000
endloop
endfacet
facet normal 1.000000e+000 0.000000e+000 0.000000e+000
outer loop
vertex 1.206000e+002 1.206000e+002 0.000000e+000
vertex 1.206000e+002 -1.900000e+001 2.450000e+001
vertex 1.206000e+002 -1.900000e+001 0.000000e+000
endloop
endfacet
facet normal 0.000000e+000 1.000000e+000 0.000000e+000
outer loop
vertex -1.900000e+001 1.206000e+002 2.450000e+001
vertex 1.206000e+002 1.206000e+002 2.450000e+001
vertex -1.900000e+001 1.206000e+002 0.000000e+000
endloop
endfacet
facet normal 0.000000e+000 1.000000e+000 0.000000e+000
outer loop
vertex -1.900000e+001 1.206000e+002 0.000000e+000
vertex 1.206000e+002 1.206000e+002 2.450000e+001
vertex 1.206000e+002 1.206000e+002 0.000000e+000
endloop
endfacet
facet normal 1.000000e+000 0.000000e+000 0.000000e+000
outer loop
vertex 0.000000e+000 1.016000e+002 2.450000e+001
vertex 0.000000e+000 0.000000e+000 2.450000e+001
vertex 0.000000e+000 1.016000e+002 0.000000e+000
endloop
endfacet
facet normal 1.000000e+000 0.000000e+000 0.000000e+000
outer loop
vertex 0.000000e+000 1.016000e+002 0.000000e+000
vertex 0.000000e+000 0.000000e+000 2.450000e+001
vertex 0.000000e+000 0.000000e+000 0.000000e+000
endloop
endfacet
facet normal 0.000000e+000 1.000000e+000 0.000000e+000
outer loop
vertex 0.000000e+000 0.000000e+000 2.450000e+001
vertex 1.016000e+002 0.000000e+000 2.450000e+001
vertex 0.000000e+000 0.000000e+000 0.000000e+000
endloop
endfacet
facet normal 0.000000e+000 1.000000e+000 0.000000e+000
outer loop
vertex 0.000000e+000 0.000000e+000 0.000000e+000
vertex 1.016000e+002 0.000000e+000 2.450000e+001
vertex 1.016000e+002 0.000000e+000 0.000000e+000
endloop
endfacet
facet normal -1.000000e+000 0.000000e+000 0.000000e+000
outer loop
vertex 1.016000e+002 0.000000e+000 2.450000e+001
vertex 1.016000e+002 1.016000e+002 2.450000e+001
vertex 1.016000e+002 0.000000e+000 0.000000e+000
endloop
endfacet
facet normal -1.000000e+000 0.000000e+000 0.000000e+000
outer loop
vertex 1.016000e+002 0.000000e+000 0.000000e+000
vertex 1.016000e+002 1.016000e+002 2.450000e+001
vertex 1.016000e+002 1.016000e+002 0.000000e+000
endloop
endfacet
facet normal 0.000000e+000 -1.000000e+000 0.000000e+000
outer loop
vertex 1.016000e+002 1.016000e+002 2.450000e+001
vertex 0.000000e+000 1.016000e+002 2.450000e+001
vertex 1.016000e+002 1.016000e+002 0.000000e+000
endloop
endfacet
facet normal 0.000000e+000 -1.000000e+000 0.000000e+000
outer loop
vertex 1.016000e+002 1.016000e+002 0.000000e+000
vertex 0.000000e+000 1.016000e+002 2.450000e+001
vertex 0.000000e+000 1.016000e+002 0.000000e+000
endloop
endfacet
endsolid

0 comments on commit 681e04c

Please sign in to comment.