Skip to content

Commit

Permalink
Merge pull request #74 from keiyamamo/tf_csm
Browse files Browse the repository at this point in the history
fix tf_csm problem
  • Loading branch information
keiyamamo committed Jun 22, 2023
2 parents 6a7a862 + 89ba3e6 commit e869c8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/test_turtleFSI.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def test_csm():

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

assert np.isclose(distance_x, distance_x_reference)
assert np.isclose(distance_y, distance_y_reference)
Expand Down
11 changes: 5 additions & 6 deletions turtleFSI/problems/TF_csm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ def set_problem_parameters(default_variables, **namespace):
# Parameters
default_variables.update(dict(
# Temporal variables
T=30, # End time [s]
T=10, # End time [s]
dt=0.01, # Time step [s]
theta=0.5, # Temporal scheme
theta=0.51, # Temporal scheme

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

return dict(bcs=[u_barwall])
return dict(bcs=[u_barwall, v_barwall])

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

0 comments on commit e869c8d

Please sign in to comment.