#file delete -force "output" #file mkdir output # source "/usr/local/espressobject_in_fluid.tcl" # what input files to read set fileNodes "input/sphere_nodes.dat" set fileTriangles "input/sphere_triangles.dat" # define your geometry here set width 20. set length 50. set height 25. set agrid 0.5 set visc 1 set rho 1 set tau 0.1 set friction 0.5 setmd time_step 0.1 setmd skin [ expr 0.4*$agrid ] thermostat off # rectangular channel box geometry set boxX [expr $width+2] set boxY $length set boxZ [expr $height+2] setmd box_l $boxX $boxY $boxZ source boundaries.tcl # initialization of the object-in-fluid mechanisms oif_init # creating templates oif_create_template template-id 0 nodes-file $fileNodes triangles-file $fileTriangles stretch 0.2 0.2 0.2 ks 10 kb 10 kv 50 set pi 3.14159265359 # adding cells oif_add_object object-id 0 template-id 0 origin 10 5 10 part-type 0 mass 1 # cell-wall interactions inter 0 10 soft-sphere 0.001 1.2 0.1 0.0 set flow_direction 1 set f_body 1.56172e-3 set f_body_vec [ list 0 0 0 ] lset f_body_vec $flow_direction $f_body lbfluid cpu agrid $agrid visc $visc dens $rho friction $friction tau $tau ext_force [ lindex $f_body_vec 0 ] [ lindex $f_body_vec 1 ] [ lindex $f_body_vec 2 ] # main iteration loop set steps 100 set counter 0 while { $counter<300 } { set cycle [expr $counter*$steps] puts "cycle $cycle" oif_object_analyze object-id 0 origin lbfluid print vtk velocity "output/fluid$counter.vtk" oif_object_output object-id 0 vtk-pos "output/particle$counter.vtk" integrate $steps incr counter }