Exemple #1
0
def interface_residual(U_F, U_Fmid, P_Fmid, D_S, U_S, D_F, D_Fmid, L_U, L_D,
                       v_F, c_S, c_F, m_D, m_U, mu_F, N_F, dFSIlist,
                       Exact_SigmaF, G_S):
    """Residual for interface conditions on the FSI interface"""
    forms = []
    for dFSI in dFSIlist:
        #Displacement Lagrange Multiplier
        R_FSI = inner(m_D, D_F - D_S)('+') * dFSI
        R_FSI += inner(c_F, L_D)('+') * dFSI

        #Velocity Lagrange Multiplier
        R_FSI += inner(m_U, U_F - U_S)('+') * dFSI
        R_FSI += inner(v_F, L_U)('+') * dFSI

        #Stress Continuity
        if Exact_SigmaF is None or Exact_SigmaF == []:
            #Calculated fluid traction on structure
            Sigma_F = PiolaTransform(_Sigma_F(U_Fmid, P_Fmid, D_Fmid, mu_F),
                                     D_Fmid)
            R_FSI += -(inner(dot(Sigma_F('+'), N_F('-')), c_S('-'))) * dFSI
        else:
            #Prescribed fluid traction on structure
            info("Using perscribed Fluid Stress on fsi boundary")
            R_FSI += (inner(Exact_SigmaF('+'), c_S('-'))) * dFSI

        #Optional boundary traction term
        if G_S is not None and G_S != []:
            info("Using additional FSI boundary traction term")
            R_FSI += inner(G_S('-'), c_S('-')) * dFSI
        forms.append(R_FSI)
    return sum(forms)
def interface_residual(U_F,U_Fmid,P_Fmid,D_S,U_S,D_F,D_Fmid,L_U,L_D,v_F,c_S,
                       c_F,m_D,m_U,mu_F,N_F,dFSIlist,Exact_SigmaF,G_S):
    """Residual for interface conditions on the FSI interface"""
    forms = []
    for dFSI in dFSIlist:
        #Displacement Lagrange Multiplier
        R_FSI =  inner(m_D, D_F - D_S)('+')*dFSI
        R_FSI += inner(c_F, L_D)('+')*dFSI

        #Velocity Lagrange Multiplier
        R_FSI += inner(m_U,U_F - U_S)('+')*dFSI
        R_FSI += inner(v_F,L_U)('+')*dFSI

        #Stress Continuity
        if Exact_SigmaF is None or Exact_SigmaF == []:
            #Calculated fluid traction on structure
            Sigma_F = PiolaTransform(_Sigma_F(U_Fmid, P_Fmid, D_Fmid, mu_F), D_Fmid)
            R_FSI += -(inner(dot(Sigma_F('+'),N_F('-')),c_S('-')))*dFSI
        else:
            #Prescribed fluid traction on structure
            info("Using perscribed Fluid Stress on fsi boundary")
            R_FSI += (inner(Exact_SigmaF('+'),c_S('-')))*dFSI
            
        #Optional boundary traction term
        if G_S is not None and G_S != []:
            info("Using additional FSI boundary traction term")
            R_FSI += inner(G_S('-'),c_S('-'))*dFSI
        forms.append(R_FSI)
    return sum(forms)
def J_FSI(dU_F,dU_Fmid,dP_Fmid,dD_Fmid,U_Fmid,P_Fmid,D_Fmid,c_S,mu_F,N_F,dFSIlist):
    """Derivative of the Interface Residual"""
    forms = []
    Sigma_F = PiolaTransform(_Sigma_F(dU_Fmid, dP_Fmid, D_Fmid, mu_F), D_Fmid)
    for dFSI in dFSIlist:   
        J_FSI = -(inner(c_S('-'),dot(Sigma_F('+'),N_F('-'))))*dFSI       
        J_FSI += -inner(c_S('-'),dot(dD_FSigmaF(D_Fmid,dD_Fmid,U_Fmid,P_Fmid,mu_F)('+'),N_F('-')))*dFSI
        forms.append(J_FSI)
    return sum(forms)
Exemple #4
0
def fluid_residual(U_Fdot,
                   U_F,
                   U1_F,
                   P_F,
                   v_F,
                   q_F,
                   mu,
                   rho,
                   D_F,
                   N_F,
                   dx_Flist,
                   ds_DNlist,
                   ds_Flist,
                   F_F,
                   D_Fdot,
                   G_F=None):
    #Fluid equation in the Domain
    forms = []
    for dx_F in dx_Flist:
        Dt_U = rho * J(D_F) * (U_Fdot +
                               dot(grad(U_F), dot(inv(F(D_F)), U_F - D_Fdot)))

        Sigma_F = PiolaTransform(_Sigma_F(U_F, P_F, D_F, mu), D_F)

        #DT
        R_F = inner(v_F, Dt_U) * dx_F

        #Div Sigma F
        R_F += inner(grad(v_F), Sigma_F) * dx_F

        #Incompressibility
        R_F += inner(q_F, div(J(D_F) * dot(inv(F(D_F)), U_F))) * dx_F

        #Right hand side Fluid (body force)
        if F_F is not None and F_F != []:
            info("Using Fluid body force")
            R_F += -inner(v_F, J(D_F) * F_F) * dx_F
        forms.append(R_F)

    #Use do nothing BC if specified
    for ds_DN in ds_DNlist:
        info("Using Do nothing Fluid BC")
        DN_F = -inner(
            v_F,
            J(D_F) * dot((mu * inv(F(D_F)).T * grad(U_F).T - P_F * I(U_F)) *
                         inv(F(D_F)).T, N_F)) * ds_DN
        forms.append(DN_F)

    #Add boundary traction (sigma dot n) to fluid boundary if specified.
    for ds_F in ds_Flist:
        info("Using Fluid boundary Traction (Neumann) BC")
        B_F = -inner(G_F, v_F) * ds_F
        forms.append(B_F)
    return sum(forms)
Exemple #5
0
def J_FSI(dU_F, dU_Fmid, dP_Fmid, dD_Fmid, U_Fmid, P_Fmid, D_Fmid, c_S, mu_F,
          N_F, dFSIlist):
    """Derivative of the Interface Residual"""
    forms = []
    Sigma_F = PiolaTransform(_Sigma_F(dU_Fmid, dP_Fmid, D_Fmid, mu_F), D_Fmid)
    for dFSI in dFSIlist:
        J_FSI = -(inner(c_S('-'), dot(Sigma_F('+'), N_F('-')))) * dFSI
        J_FSI += -inner(
            c_S('-'),
            dot(
                dD_FSigmaF(D_Fmid, dD_Fmid, U_Fmid, P_Fmid, mu_F)
                ('+'), N_F('-'))) * dFSI
        forms.append(J_FSI)
    return sum(forms)
def fluid_residual(U_Fdot,U_F,U1_F,P_F,v_F,q_F,mu,rho,D_F,N_F,dx_Flist,ds_DNlist,ds_Flist,
                   F_F,D_Fdot, G_F=None):
    #Fluid equation in the Domain
    forms = []
    for dx_F in dx_Flist:
        Dt_U = rho*J(D_F)*(U_Fdot + dot(grad(U_F),dot(inv(F(D_F)),U_F - D_Fdot)))
            
        Sigma_F = PiolaTransform(_Sigma_F(U_F, P_F, D_F, mu), D_F)

        #DT
        R_F  = inner(v_F, Dt_U)*dx_F                                                                      

        #Div Sigma F
        R_F += inner(grad(v_F), Sigma_F)*dx_F

        #Incompressibility
        R_F += inner(q_F, div(J(D_F)*dot(inv(F(D_F)), U_F)))*dx_F

        #Right hand side Fluid (body force)
        if F_F is not None and F_F != []:
            info("Using Fluid body force")
            R_F += -inner(v_F,J(D_F)*F_F)*dx_F
        forms.append(R_F)

    #Use do nothing BC if specified
    for ds_DN in ds_DNlist:
        info("Using Do nothing Fluid BC")
        DN_F = -inner(v_F, J(D_F)*dot((mu*inv(F(D_F)).T*grad(U_F).T - P_F*I(U_F))*inv(F(D_F)).T, N_F))*ds_DN
        forms.append(DN_F)
                       
    #Add boundary traction (sigma dot n) to fluid boundary if specified.
    for ds_F in ds_Flist:
        info("Using Fluid boundary Traction (Neumann) BC")
        B_F =  -inner(G_F, v_F)*ds_F
        forms.append(B_F)
    return sum(forms)