Hello. I am trying to simulate the injection of contrast through a concentric tube inside another tube. My code works but I’m not sure how to give the injection velocity a contrast value of 1 so I can see how the contrast with a certain injection speed mixes with the flow that is coming from the large tube.
Currently, I have a dirichlet boundary of 1 (for the concentration) set at the boundary where fluid is being injected (at injection_speed=50) but this is not giving realistic results. I want the injection fluid to have concentration with a value of 1. Any help would be appreciated.
# DEFINE MIXED VECTOR FUNCTION
# =====================================================================
V = VectorElement("Lagrange", mesh.ufl_cell(), 2)
P = FiniteElement("Lagrange", mesh.ufl_cell(), 1)
M = MixedElement([V,P,P])
W = FunctionSpace(mesh,M)
# =====================================================================
# COLLECT BOUNDARY CONDITIONS
# =====================================================================
ID_TOP_VESSEL = 1
ID_RIGHT_VESSEL = 2
ID_BOTTOM_VESSEL = 3
ID_LEFT_VESSEL = 4
ID_OUTTER_CATH = 5
ID_INNER_CATH = 6
ID_TIPS_CATH = 7
ID_ENTRANCE_CATH = 8
uD_Zero = Constant((0.0,0.0))
u_inlet = Function(W.sub(0).collapse())
u_copy = u_inlet.copy(deepcopy=True)
u_copy.vector()[:] = 1
p_1 = Constant(0.0)
pressu = pressure(dp_dz, omega2, waves, 0)
p_0 = Constant(pressu)
inject_speed = Constant((50.0,0.0))
inflow = DirichletBC(W.sub(1), p_0, domainBoundaries, ID_LEFT_VESSEL)
bc_Top_Vess = DirichletBC(W.sub(0), uD_Zero, domainBoundaries, ID_TOP_VESSEL)
bc_Right_Vess = DirichletBC(W.sub(1), p_1, domainBoundaries, ID_RIGHT_VESSEL)
bc_Left_Vess = DirichletBC(W.sub(0), u_copy, domainBoundaries, ID_LEFT_VESSEL)
bc_Bottom_Vess = DirichletBC(W.sub(0), uD_Zero, domainBoundaries, ID_BOTTOM_VESSEL)
bc_Outter_Cath = DirichletBC(W.sub(0), uD_Zero, domainBoundaries, ID_OUTTER_CATH)
bc_Inner_Cath = DirichletBC(W.sub(0), uD_Zero, domainBoundaries, ID_INNER_CATH)
bc_Tips_Cath = DirichletBC(W.sub(0), uD_Zero, domainBoundaries, ID_TIPS_CATH)
bc_Inlet_Cath = DirichletBC(W.sub(0), inject_speed,domainBoundaries, ID_ENTRANCE_CATH)
bcu = [inflow,bc_Top_Vess, bc_Right_Vess, bc_Left_Vess, bc_Bottom_Vess, bc_Outter_Cath, bc_Inner_Cath, bc_Tips_Cath, bc_Inlet_Cath]
#Concentration
init_c = Constant(1.0)
bcT_inflow_large_tube = DirichletBC(W.sub(2), Constant(0.2), domainBoundaries, ID_LEFT_VESSEL)
bcT_inflow_small_tube = DirichletBC(W.sub(2), init_c, domainBoundaries, ID_ENTRANCE_CATH)
bcT = [bcT_inflow,bcT_noslip3]
bcs = bcu + bcT
#Navier Stokes
F1 = (inner(grad(u)*u, v)*dx + # Momentum advection term
mu*inner(grad(u), grad(v))*dx - # Momentum diffusion term
inner(p, div(v))*dx + # Pressure term
div(u)*q*dx
)
#Advection-diffusion
F2_1 = (inner(u,grad(C))*s*dx + # advection term
Diff*(inner(grad(C), grad(s))*dx # diffusion
)