Skip to content

Commit e869c8d

Browse files
authored
Merge pull request #74 from keiyamamo/tf_csm
fix tf_csm problem
2 parents 6a7a862 + 89ba3e6 commit e869c8d

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

tests/test_turtleFSI.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def test_csm():
3030

3131
distance_x = np.loadtxt("tmp/2/dis_x.txt")[-1]
3232
distance_y = np.loadtxt("tmp/2/dis_y.txt")[-1]
33-
distance_x_reference = -3.312418050495862e-05
34-
distance_y_reference = -0.003738529237136441
33+
distance_x_reference = -3.313014369394714527e-05
34+
distance_y_reference = -3.770127311444726199e-03
3535

3636
assert np.isclose(distance_x, distance_x_reference)
3737
assert np.isclose(distance_y, distance_y_reference)

turtleFSI/problems/TF_csm.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ def set_problem_parameters(default_variables, **namespace):
2121
# Parameters
2222
default_variables.update(dict(
2323
# Temporal variables
24-
T=30, # End time [s]
24+
T=10, # End time [s]
2525
dt=0.01, # Time step [s]
26-
theta=0.5, # Temporal scheme
26+
theta=0.51, # Temporal scheme
2727

2828
# Physical constants
29-
rho_f=1.0e3, # Fluid density [kg/m3]
30-
mu_f=1.0, # Fluid dynamic viscosity [Pa.s]
3129
rho_s=1.0e3, # Solid density[kg/m3]
3230
mu_s=0.5e6, # Shear modulus, 2nd Lame Coef. CSM3: 0.5E6 [Pa]
3331
nu_s=0.4, # Solid Poisson ratio [-]
@@ -84,8 +82,9 @@ def initiate(f_L, R, c_x, c_y, **namespace):
8482
def create_bcs(DVP, boundaries, **namespace):
8583
# Clamp on the left hand side
8684
u_barwall = DirichletBC(DVP.sub(0), ((0.0, 0.0)), boundaries, 1)
85+
v_barwall = DirichletBC(DVP.sub(1), ((0.0, 0.0)), boundaries, 1)
8786

88-
return dict(bcs=[u_barwall])
87+
return dict(bcs=[u_barwall, v_barwall])
8988

9089
################################################################################
9190
# the function mpi4py_comm and peval are used to overcome FEniCS limitation of
@@ -139,4 +138,4 @@ def finished(results_folder, displacement_x_list, displacement_y_list, time_list
139138
if MPI.rank(MPI.comm_world) == 0:
140139
np.savetxt(path.join(results_folder, 'Time.txt'), time_list, delimiter=',')
141140
np.savetxt(path.join(results_folder, 'dis_x.txt'), displacement_x_list, delimiter=',')
142-
np.savetxt(path.join(results_folder, 'dis_y.txt'), displacement_y_list, delimiter=',')
141+
np.savetxt(path.join(results_folder, 'dis_y.txt'), displacement_y_list, delimiter=',')

0 commit comments

Comments
 (0)