Skip to content
Snippets Groups Projects
Commit 87cb08b2 authored by noels's avatar noels
Browse files

add bounds for geometry 8

parent 2ae1e068
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ file = open('Density.dat','a+')
file.close()
def Geo_generator(name, rho, vfr, length, width, height, sb, Radius, vfraction):
def Geo_generator(name, rho, vfr, length, width, height, sb, Radius, vfraction, bow_h, bow_angle):
if vfr=="a":
if name =="92":
print ("NOTE: geo 92 does not work with option a")
......@@ -315,15 +315,7 @@ def Geo_generator(name, rho, vfr, length, width, height, sb, Radius, vfraction):
#tie points:(connection) tie_p
#angle of bow corner: bow_angle
#f and c correspond to close and far from axis x,y,z
#inputs:
#bow_h=float(input())
bow_h=0.75
print ("bow heinght between 0 and size of unit cell, chosen:", bow_h)
#bow_angle=float(input())
bow_angle=75
print ("bow angle between 60º and 90º, chosen: "+ str(bow_angle)+"º")
#-------calculations
tie_l=((math.sin(math.radians(90-bow_angle))/math.sin(math.radians(bow_angle)))*sb/2)
......
......@@ -24,16 +24,26 @@ import matplotlib.pyplot as plt
from Auto_geometry_parametric import *
#############Can be changed##########################
cellType = "3" # from "2", "3", "4", "5", "6", "7", "8", "9", "91" (or "92" if typeRand ="b")
cellType = "8" # from "2", "3", "4", "5", "6", "7", "8", "9", "91" (or "92" if typeRand ="b")
typeRand = "a" # "a" for random volume fraction and "b" for random radius
VmFrMax = 0.2 #bound of random volume fraction, for geometry 8: 0.15 is a maximum, for other geometry 0.3 is a maximum
nx =2 #number of cell along x
ny =2 #number of cell along y
nz =2 #number of cell along z
nx =1 #number of cell along x
ny =1 #number of cell along y
nz =1 #number of cell along z
VmFrMin = 0.05 #lower bound of random volume fraction, for geometry 8: 0.15 is a maximum, for other geometry 1. is a maximum
VmFrMax = 0.25 #max bound of random volume fraction, for geometry 8: 0.15 is a maximum, for other geometry 1. is a maximum
sizemin=0.2 #minimum size of unit cell
sizemax=2.5 # maximum size of unit cell
radiusmin =0.1 #minimum ratio of radius with respect to cell length
radiusmax =0.9 #maximum ratio of radius with respect to cell length
bow_h_min =0.5 #minimum bow of cell 8 with respect to cell length
bow_h_max = 0.8 #maximum bow of cell 8 with respect to cell length
bow_angle_min=65 #minimum bow of cell 8, automatically corrected from bow_h if too low
bow_angle_max=85 #minimum bow of cell 8, should be lower than 90
#############Cannot be changed##############################
vf_tpye=["a", "b"]
GeoID = []
......@@ -63,18 +73,19 @@ height = cell_num[2]
####################################################
if cell_name!="8":
if(VmFrMax>0.3):
VmFrMax=0.3
if cell_name=="8":
if(VmFrMax>0.15):
VmFrMax=0.15
VmFr=VmFrMax*np.random.uniform()
VmFr=np.random.uniform(VmFrMin,VmFrMax)
sb = np.random.uniform(sizemin, sizemax) #Set size of unit cell
Radius = np.random.uniform()*sb
Geo, Radi = Geo_generator(cell_name, rho, vfr, length, width, height, sb, Radius, VmFr)
Radius = np.random.uniform(radiusmin,radiusmax)*sb
bow_h=np.random.uniform(bow_h_min,bow_h_max)*sb
bow_angle=np.random.uniform(min(bow_angle_min,1.1*math.atan(sb/bow_h)*180./math.pi),bow_angle_max)
Geo, Radi = Geo_generator(cell_name, rho, vfr, length, width, height, sb, Radius, VmFr,bow_h,bow_angle)
V_R_S = [VmFr, Radi, sb]
print("Create geo file ", Geo, " cell type ", cell_name, " of volume fraction type", vfr, "with as results: volume fraction ", VmFr," Radius ", Radi)
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment