Skip to content

Commit

Permalink
Noticed few discrepancies between code and documentation on Robin BC.
Browse files Browse the repository at this point in the history
Made the Robin BC in the code consistent with the documentation
and general understanding. Commit also includes few minor updates
to documentation and computing second-order derivatives for FLUID
and FSI irrespective of Taylor-Hood element flag.
  • Loading branch information
vvedula22 committed Sep 26, 2021
1 parent e258b9f commit 9c30521
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 43 deletions.
6 changes: 2 additions & 4 deletions Code/Source/svFSI/FLUID.f
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,8 @@ SUBROUTINE CONSTRUCT_FLUID(lM, Ag, Yg)
2 ksix)
IF (ISZERO(Jac)) err = "Jac < 0 @ element "//e

IF (.NOT.vmsStab) THEN
CALL GNNxx(l, fs(1)%eNoN, nsd, fs(1)%Nx(:,:,g),
2 fs(1)%Nxx(:,:,g), xwl, Nwx, Nwxx)
END IF
CALL GNNxx(l, fs(1)%eNoN, nsd, fs(1)%Nx(:,:,g),
2 fs(1)%Nxx(:,:,g), xwl, Nwx, Nwxx)
END IF
w = fs(1)%w(g) * Jac

Expand Down
6 changes: 2 additions & 4 deletions Code/Source/svFSI/FSI.f
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,8 @@ SUBROUTINE CONSTRUCT_FSI(lM, Ag, Yg, Dg)
2 ksix)
IF (ISZERO(Jac)) err = "Jac < 0 @ element "//e

IF (.NOT.vmsStab) THEN
CALL GNNxx(l, fs(1)%eNoN, nsd, fs(1)%Nx(:,:,g),
2 fs(1)%Nxx(:,:,g), xwl, Nwx, Nwxx)
END IF
CALL GNNxx(l, fs(1)%eNoN, nsd, fs(1)%Nx(:,:,g),
2 fs(1)%Nxx(:,:,g), xwl, Nwx, Nwxx)
END IF
w = fs(1)%w(g) * Jac

Expand Down
36 changes: 18 additions & 18 deletions Code/Source/svFSI/SETBC.f
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,9 @@ SUBROUTINE SETBCRBNL(lFa, ks, cs, isN, Yg, Dg)

IF (nsd .EQ. 3) THEN
DO a=1, eNoN
lR(1,a) = lR(1,a) - w*N(a)*h(1)
lR(2,a) = lR(2,a) - w*N(a)*h(2)
lR(3,a) = lR(3,a) - w*N(a)*h(3)
lR(1,a) = lR(1,a) + w*N(a)*h(1)
lR(2,a) = lR(2,a) + w*N(a)*h(2)
lR(3,a) = lR(3,a) + w*N(a)*h(3)
END DO

IF (cPhys .EQ. phys_ustruct) THEN
Expand Down Expand Up @@ -542,24 +542,24 @@ SUBROUTINE SETBCRBNL(lFa, ks, cs, isN, Yg, Dg)
DO a=1, eNoN
DO b=1, eNoN
T1 = N(a)*N(b)
lK(1,a,b) = lK(1,a,b) - wl*T1*nDn(1,1)
lK(2,a,b) = lK(2,a,b) - wl*T1*nDn(1,2)
lK(3,a,b) = lK(3,a,b) - wl*T1*nDn(1,3)
lK(1,a,b) = lK(1,a,b) + wl*T1*nDn(1,1)
lK(2,a,b) = lK(2,a,b) + wl*T1*nDn(1,2)
lK(3,a,b) = lK(3,a,b) + wl*T1*nDn(1,3)

lK(dof+1,a,b) = lK(dof+1,a,b) - wl*T1*nDn(2,1)
lK(dof+2,a,b) = lK(dof+2,a,b) - wl*T1*nDn(2,2)
lK(dof+3,a,b) = lK(dof+3,a,b) - wl*T1*nDn(2,3)
lK(dof+1,a,b) = lK(dof+1,a,b) + wl*T1*nDn(2,1)
lK(dof+2,a,b) = lK(dof+2,a,b) + wl*T1*nDn(2,2)
lK(dof+3,a,b) = lK(dof+3,a,b) + wl*T1*nDn(2,3)

lK(2*dof+1,a,b) = lK(2*dof+1,a,b)-wl*T1*nDn(3,1)
lK(2*dof+2,a,b) = lK(2*dof+2,a,b)-wl*T1*nDn(3,2)
lK(2*dof+3,a,b) = lK(2*dof+3,a,b)-wl*T1*nDn(3,3)
lK(2*dof+1,a,b) = lK(2*dof+1,a,b)+wl*T1*nDn(3,1)
lK(2*dof+2,a,b) = lK(2*dof+2,a,b)+wl*T1*nDn(3,2)
lK(2*dof+3,a,b) = lK(2*dof+3,a,b)+wl*T1*nDn(3,3)
END DO
END DO
END IF
ELSE IF (nsd .EQ. 2) THEN
DO a=1, eNoN
lR(1,a) = lR(1,a) - w*N(a)*h(1)
lR(2,a) = lR(2,a) - w*N(a)*h(2)
lR(1,a) = lR(1,a) + w*N(a)*h(1)
lR(2,a) = lR(2,a) + w*N(a)*h(2)
END DO

IF (cPhys .EQ. phys_ustruct) THEN
Expand Down Expand Up @@ -592,10 +592,10 @@ SUBROUTINE SETBCRBNL(lFa, ks, cs, isN, Yg, Dg)
DO a=1, eNoN
DO b=1, eNoN
T1 = N(a)*N(b)
lK(1,a,b) = lK(1,a,b) - wl*T1*nDn(1,1)
lK(2,a,b) = lK(2,a,b) - wl*T1*nDn(1,2)
lK(dof+1,a,b) = lK(dof+1,a,b) - wl*T1*nDn(2,1)
lK(dof+2,a,b) = lK(dof+2,a,b) - wl*T1*nDn(2,2)
lK(1,a,b) = lK(1,a,b) + wl*T1*nDn(1,1)
lK(2,a,b) = lK(2,a,b) + wl*T1*nDn(1,2)
lK(dof+1,a,b) = lK(dof+1,a,b) + wl*T1*nDn(2,1)
lK(dof+2,a,b) = lK(dof+2,a,b) + wl*T1*nDn(2,2)
END DO
END DO
END IF
Expand Down
22 changes: 17 additions & 5 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,18 @@ Recommended folder structure:
```bash
mkdir svFSI
cd svFSI
git clone git@github.com:SimVascular/svFSI.git
git clone https://github.com/SimVascular/svFSI.git
mv svFSI src
mkdir build
cd build
```

If you have `ssh` keys set up on GitHub, you may clone using the following command instead of the above `https` ones,

```bash
git clone git@github.com:SimVascular/svFSI.git
```

This structure creates a separate directory for `svFSI` git repository `src` and a separate `build` folder where `svFSI` is compiled.

### Build environment:
Expand Down Expand Up @@ -205,18 +211,24 @@ Please make sure to update the `BLASDIR` location depending on the version of Op
7. Download `svFSI` from GitHub:

```bash
mkdir svFSI-git
cd svFSI-git
git clone git@github.com:SimVascular/svFSI.git
mkdir svFSI
cd svFSI
git clone https://github.com/SimVascular/svFSI.git
mv svFSI/ src
```

If you have `ssh` keys set up on GitHub, you may clone using the following command instead of the above `https` ones,

```bash
git clone git@github.com:SimVascular/svFSI.git
```

8. Create a separate `build` folder and compile using the following commands:

```bash
mkdir build
cd build
ccmake ../
ccmake ../src
make
```
## =================================================================
30 changes: 18 additions & 12 deletions svFSI_master.inp
Original file line number Diff line number Diff line change
Expand Up @@ -987,26 +987,32 @@ Add equation: FSI # [heatS/heatF/lElas/struct/ustruct/stokes/fluid/CMM/FSI/mesh
# #------------ Additional Robin BC controls
# 10. Robin BC types involves a spring-mass-damper-type force
# application on the surface upon which Robin BC is applied.
# The mathematical expression evaluates to, h = -k*u - c*v,
# The mathematical expression evaluates to,
# \sigma.n = -(k*u + c*v + p*n),
# where k is the stiffness parameter and c is the damping
# constant, while u and v are the surface displacement and
# velocity, respectively.
# Therefore, additional parameters need to be provided if
# Robin BC type is set including "Stiffness" and "Damping"
# constants. For e.g.,
# velocity, respectively. p is the external pressure acting
# along normal direction.
# In svFSI, Robin BC is only an extension to the Neumann
# boundary condition and therefore, all the commands for the
# Neumann BC are accepted for Robin BC as well. However,
# additional parameters must be provided for Robin BC that
# include "Stiffness" and "Damping" constants, and whether
# the Robin BC is applied along the normal or not. For e.g.,
#
# Add BC: face_name {
# Type: Robin
# Time dependence: Steady
# Value: 0.0
# Stiffness : 1.0e5
# Damping: 0.0
# Applied along normal direction: f
# }
#
# If there is an additional load on the face (i.e.,
# h = -k*u - c*v - pn), one may use Neumann BC on the same
# face as,
# Add BC : face_name {
# Type : Neu
# Value: 1.0e4
# }
# When the Robin BC is applied along the normal direction,
# the applied surface traction takes the form,
# \sigma.n = -(k u.n + c v.n - p)n
#
#
# #------------ Additional CMM type BC controls
# 11. If a face (typically a fluid wall/interface) is set to be
Expand Down

0 comments on commit 9c30521

Please sign in to comment.