forked from yjhp1016/taichi_LBM3D
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jianhui
committed
Aug 17, 2022
1 parent
b4e09bc
commit 13bcb7d
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import LBM_3D_SinglePhase_Solver as lb3dsp | ||
import time | ||
|
||
time_init = time.time() | ||
time_now = time.time() | ||
time_pre = time.time() | ||
|
||
|
||
lb3d = lb3dsp.LB3D_Solver_Single_Phase(50,50,50) | ||
|
||
lb3d.init_geo('./geo_cavity.dat') | ||
lb3d.set_bc_vel_x1([0.0,0.0,0.1]) | ||
lb3d.init_simulation() | ||
|
||
for iter in range(50000+1): | ||
lb3d.step() | ||
|
||
if (iter%1000==0): | ||
|
||
time_pre = time_now | ||
time_now = time.time() | ||
diff_time = int(time_now-time_pre) | ||
elap_time = int(time_now-time_init) | ||
m_diff, s_diff = divmod(diff_time, 60) | ||
h_diff, m_diff = divmod(m_diff, 60) | ||
m_elap, s_elap = divmod(elap_time, 60) | ||
h_elap, m_elap = divmod(m_elap, 60) | ||
|
||
print('----------Time between two outputs is %dh %dm %ds; elapsed time is %dh %dm %ds----------------------' %(h_diff, m_diff, s_diff,h_elap,m_elap,s_elap)) | ||
print('The %dth iteration, Max Force = %f, force_scale = %f\n\n ' %(iter, 10.0, 10.0)) | ||
|
||
if (iter%10000==0): | ||
lb3d.export_VTK(iter) | ||
|