22from proteus import Domain
33from proteus .mprans import SpatialTools as st
44from proteus .mbd import CouplingFSI as fsi
5+ import pychrono as chrono
56from proteus .TwoPhaseFlow import TwoPhaseFlowProblem as tpf
67from proteus .TwoPhaseFlow .utils import Parameters
7- import pychrono as chrono
88import os
99
1010rho_0 = 1000.
2626rect .setHoles (holes = np .array ([rect .coords ]))
2727
2828domain .MeshOptions .he = he
29-
3029# BOUNDARY CONDITIONS
3130
3231tank .BC ['x+' ].setNoSlip ()
4241# CHRONO
4342
4443system = fsi .ProtChSystem ()
45- system .ChSystem .Set_G_acc (chrono .ChVectorD (g [0 ], g [1 ], 0. ))
44+ system .ChSystem .SetGravitationalAcceleration (chrono .ChVector3d (g [0 ], g [1 ], 0. ))
4645body = fsi .ProtChBody (system = system )
4746body .attachShape (rect )
4847body .ChBody .SetMass (500. )
49- body .ChBody .SetBodyFixed (True ) # fixing body
48+ body .ChBody .SetFixed (True ) # fixing body
5049
5150# OTHER PARAMS
5251st .assembleDomain (domain )
@@ -95,9 +94,7 @@ def uOfXT(self,x,t):
9594
9695myTpFlowProblem .SystemNumerics .cfl = 0.4
9796myTpFlowProblem .SystemNumerics .useSuperlu = False
98-
9997myTpFlowProblem .SystemPhysics .movingDomain = False
100-
10198params = myTpFlowProblem .SystemPhysics
10299
103100# PHYSICAL PARAMETERS
@@ -117,8 +114,8 @@ def uOfXT(self,x,t):
117114myTpFlowProblem .SystemPhysics .modelDict ['flow' ].p .initialConditions ['v' ]= AtRest ()
118115myTpFlowProblem .SystemPhysics .modelDict ['addedMass' ].p .initialConditions ['addedMass' ]= AtRest ()
119116
120- m ['flow' ].p .coefficients .NONCONSERVATIVE_FORM = 0 .0
121- m ['flow' ].p .coefficients .useVF = 1 .0
117+ m ['flow' ].p .coefficients .useVF = 1 .0
118+ m ['flow' ].p .coefficients .NONCONSERVATIVE_FORM = 0 .0
122119
123120# auxiliary variables
124121m ['flow' ].auxiliaryVariables += [system ]
@@ -135,6 +132,8 @@ def uOfXT(self,x,t):
135132flags_rigidbody = np .zeros (max_flag + 1 , dtype = 'int32' )
136133for s in system .subcomponents :
137134 if type (s ) is fsi .ProtChBody :
138- for flag in body .boundaryFlags :
135+ for flag in s .boundaryFlags :
139136 flags_rigidbody [flag ] = 1
140137m ['addedMass' ].p .coefficients .flags_rigidbody = flags_rigidbody
138+ m ['addedMass' ].n .linTolFac = 0.0
139+ m ['addedMass' ].n .l_atol_res = 1.0e-10
0 commit comments