-
Notifications
You must be signed in to change notification settings - Fork 22
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
[WIP] Hypervisco #68
[WIP] Hypervisco #68
Conversation
…vily worked to make it efficient in terms of jitting.
Leaving it as a draft so we can iterate on what model form/features will suite all of our needs |
… on large problems though, but the jitting time is acceptable.
def create_mechanics_functions(functionSpace, mode2D, materialModel, | ||
pressureProjectionDegree=None, | ||
dt=0.0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Late comment. Can I ask, why did dt
get moved into the factory function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remember correctly, things weren't properly connected so dt wasn't making its way to the material models. Maybe I misunderstood the interface as it was though?
state_new = (Fv_inc @ Fv_old).ravel() | ||
return state_new | ||
|
||
def _compute_state_increment(dispGrad, stateOld, dt, props): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The J2 model had this function so that we could put the finite strain and the infinitesimal strain versions in one implementation. For this model, which only makes sense as a finite deformation model, we might as well do all of the update in the _compute_state_new()
function which will make it easier to read. Maybe this will speed things up a little, too.
# def vmap_body(n, Fv): | ||
# G_neq = props[PROPS_G_neq + 2 * n] | ||
# # tau = props[PROPS_TAU + 2 * n] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, If we end up implementing multiple Prony terms, I'd suggest trying with a jax.lax.fori
loop, or jax.lax.scan
. I think it might be more straightforward than vmap
.
Sorry, I kind of rushed and merged this in. Should we create a separate pull request to address Brandon's comments? |
This pull request implements a simple isotropic hyperviscoelastic model under the assumption of incompressible viscous flow with an arbitrary number of prony terms. The model form looks like the following
where
Currently the equilibrium branch is a NeoHookean model, but we can generalize this later. The non-equilibrium branch currently has the following model form
$\psi^{neq}_i = G_i|\dev\mathbf{E}_i^e|^2$
Kinematics
$\mathbf{F} = \mathbf{F}^e_i\mathbf{F}^v_i,$
Flow rule update
$\dot{\mathbf{F}}^v_i = \mathbf{D}^v_i\mathbf{F}^v_i$
where the above is
$\mathbf{D}^v_i = \dot{\gamma}^v_i\left(\frac{\dev\mathbf{M}^e_i}{2\bar{M}_i}\right)$
For now a simple viscous shearing rate suitable for polymers in the rubbery state is used and is shown below
Constitutive model update [WIP]
Start with standard exponential rule
$\mathbf{F}^v_{n+1} = \exp\left(\Delta t\mathbf{D}^v_{n + 1}\right)\mathbf{F}^v_n,$
Do the usual stuff to show
For this particular for of the viscous shearing rate we get lucky and have an analytic solution
What I'm unsure about is what the variational update looks like...
Currently, I'm simply return this
$\psi_{eq} + \psi_{neq} + \frac{1}{2}\Delta t \eta \dot{\gamma}_v^2$
where$\eta = G\tau$
Also in the pull request a patched up some interface issues with mechanics functions related to a time step.