Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ustruct and volumetric material tests #229

Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion Code/Source/svFSI/mat_models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,18 @@ void get_fib_stress(const ComMod& com_mod, const CepMod& cep_mod, const fibStrsT
///
/// Reproduces the Fortran 'GETPK2CC' subroutine.
//
// ARGS:
// - com_mod: Object containing global common variables.
// - cep_mod: Object containing electrophysiology-specific common variables.
// - lDmn: Domain object
// - F: Deformation gradient tensor
// - nfd: Number of fiber directions
// - fl: Fiber directions
// - ya: Electrophysiology active stress
// - S: 2nd Piola-Kirchhoff stress tensor
// - Dm: Material stiffness tensor
//
// RETURNS: None, but modifies S and Dm in place.
void get_pk2cc(const ComMod& com_mod, const CepMod& cep_mod, const dmnType& lDmn, const Array<double>& F, const int nfd,
const Array<double>& fl, const double ya, Array<double>& S, Array<double>& Dm)
{
Expand Down Expand Up @@ -483,6 +495,19 @@ void get_pk2cc(const ComMod& com_mod, const CepMod& cep_mod, const dmnType& lDmn
///
/// Reproduces 'SUBROUTINE GETPK2CCdev(lDmn, F, nfd, fl, ya, S, Dm, Ja)'.
//
// ARGS:
// - com_mod: Object containing global common variables.
// - cep_mod: Object containing electrophysiology-specific common variables.
// - lDmn: Domain object
// - F: Deformation gradient tensor
// - nfd: Number of fiber directions
// - fl: Fiber directions
// - ya: Electrophysiology active stress
// - S: 2nd Piola-Kirchhoff stress tensor (isochoric part)
// - Dm: Material stiffness tensor (isochoric part)
// - Ja: Jacobian for active strain
//
// RETURNS: None, but modifies S, Dm, and Ja in place.
void get_pk2cc_dev(const ComMod& com_mod, const CepMod& cep_mod, const dmnType& lDmn, const Array<double>& F, const int nfd,
const Array<double>& fl, const double ya, Array<double>& S, Array<double>& Dm, double& Ja)
{
Expand Down Expand Up @@ -765,7 +790,7 @@ void get_pk2cc_dev(const ComMod& com_mod, const CepMod& cep_mod, const dmnType&
}

double r1 = J2d*mat_ddot(C, Sb, nsd) / nd;
auto S = J2d*Sb - r1*Ci;
mrp089 marked this conversation as resolved.
Show resolved Hide resolved
S = J2d*Sb - r1*Ci;

auto PP = ten_ids(nsd) - (1.0/nd) * ten_dyad_prod(Ci, C, nsd);
CC = ten_ddot(CCb, PP, nsd);
Expand Down Expand Up @@ -1409,6 +1434,21 @@ void get_tau(const ComMod& com_mod, const dmnType& lDmn, const double detF, cons
tauC = ctC * (he*c) * (rho0/detF);
}

/// @brief Compute rho, beta, drho/dp, dbeta/dp for volumetric penalty terms in
/// the ustruct formulation.
/// See ustruct paper (https://doi.org/10.1016/j.cma.2018.03.045) Section 2.4
//
// ARGS:
// com_mod: ComMod object
// lDmn: dmnType object
// p: pressure
// ro: Solid density, rho
// bt: Isothermal compressibility coefficient, beta
// dro: Derivative of rho w.r.t. p
// dbt: Derivative of beta w.r.t. p
// Ja: Active strain Jacobian
//
// RETURNS: None, but updates ro, bt, dro, dbt
void g_vol_pen(const ComMod& com_mod, const dmnType& lDmn, const double p,
double& ro, double& bt, double& dro, double& dbt, const double Ja)
{
Expand Down
17 changes: 17 additions & 0 deletions Code/Source/svFSI/mat_models_carray.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,23 @@ void voigt_to_cc_carray(const double Dm[2*N][2*N], double CC[N][N][N][N]) {
// get_pk2cc
//-----------
//
/// @brief Compute 2nd Piola-Kirchhoff stress and material stiffness tensors
/// including both dilational and isochoric components.
///
/// Reproduces the Fortran 'GETPK2CC' subroutine.
//
// ARGS:
// - com_mod: Object containing global common variables.
// - cep_mod: Object containing electrophysiology-specific common variables.
// - lDmn: Domain object
// - F: Deformation gradient tensor
// - nfd: Number of fiber directions
// - fl: Fiber directions
// - ya: Electrophysiology active stress
// - S: 2nd Piola-Kirchhoff stress tensor
// - Dm: Material stiffness tensor
//
// RETURNS: None, but modifies S and Dm in place
template <size_t N>
void get_pk2cc(const ComMod& com_mod, const CepMod& cep_mod, const dmnType& lDmn, const double F[N][N], const int nfd,
const Array<double>& fl, const double ya, double S[N][N], double Dm[2*N][2*N])
Expand Down
17 changes: 17 additions & 0 deletions Code/Source/svFSI/ustruct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/*
This structural mechanics implementation is based on the following reference:

Ju Liu, Alison L. Marsden,
A unified continuum and variational multiscale formulation for fluids, solids, and fluid–structure interaction,
Computer Methods in Applied Mechanics and Engineering,
Volume 337,
2018,
Pages 549-597,
ISSN 0045-7825,
https://doi.org/10.1016/j.cma.2018.03.045.

This paper describes a unified framework for fluid, solids, and FSI. The code
in this file is based on the solid mechanics portion of the paper, which can be
found in Section 4
*/

#include "ustruct.h"

#include "all_fun.h"
Expand Down
Loading
Loading