-
Notifications
You must be signed in to change notification settings - Fork 44
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: Viscoelastic modeling and VIV for Lines #290
base: dev
Are you sure you want to change the base?
Conversation
…VIV synch model params
… Made # a comment character in input files. Readded diable VIV during ICgen
…ffness is now live!
…c states should be accounted for)
…near look up table it assumed stress strain. This is not correct and doesnt match theory paper or docs. CHanges to stress tension.
I was waiting for this! Niiiceee!
I am checking out ASAP
…On Tue, 14 Jan 2025, 18:59 Ryan Davies, ***@***.***> wrote:
@RyanDavies19 <https://github.com/RyanDavies19> requested your review on:
#290 <#290> WIP:
Viscoelastic modeling and VIV for Lines.
—
Reply to this email directly, view it on GitHub
<#290 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMXKKBUMFFVSK5KC6W57VL2KVGANAVCNFSM6AAAAABVFOTULSVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJVHEZDOOBUGU2TEOI>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
Hey guys! We come with this solution: The first significant change is that we are removing StateVarDeriv because:
The next significant change is that we are not specializing the state variables according to the kind of entity anymore. Instead of that the state variables will be typedefed Eigen matrices besides an indexer which is able to identify each entity with a submatrix. That should allow very idiomatic approaches to operate with the states. E.g. for a explicit 1st order Euler we would have the following pseudo-code:
Finally, since we are setting the state variables as a mapped object, we can always install state variables on demand. That should give us functionality enough to have "n more states per node". We just need to install state variables with names "subspring_001", "subspring_002", ... This is not requiring an unacceptable amount of work. It is not for free either... Please, give us some feedback before we start chewing keystrokes :-p |
Hi @sanguinariojoe, I like this general approach, and I appreciate its flexibility in terms of future work adding new states to various objects. It's good to stay flexible because you never know what next crazy cool idea someone comes up with. To address your two bullet points: I probably could've made it more clear but every state in the system is found by integrating its derivative in the previous step. Additionally, I'm not quite sure I would consider acceleration a state now as much as we are approximating it in the current step by using the value of the previous step (in the context of the VIV model). Some clarifying questions so I can wrap my head around it:
Let me know your thoughts on these comments. As always, impressive work from you all coming up with these nice structures. |
That's so far the idea. The hierarchy is not exactly that though. The time integrator will own NSTATES States, and each State will own a map of StateVars, indexed by their names. Each StateVar is actually a matrix, where the number of rows is invariably N = the number of DOFs (as 1 per point and body, and n_nodes per line and rod). Thus, we can model simple scalars as Besides that, the State will hold also a double-entry indexer which allows to associate It will be hereby possible to access state variables to operate them indexing by the name, e.g. Also the structure will make easy (but maybe not that efficient) to remove and add instances (e.g. line break). The merit is that it will be idiomatically nice, and I suppose quite efficient. The drawback is that some StateVars will be useless for some entities (like the subsprings for points, bodies and rods). This will not impact the performance (I hope).
I plan to get everything ready to can handle derivatives (which will be now StateVars anyway) either by external imposition (so far like it happens right now, with some kind of getStateDeriv) or by internal computation (e.g. from the beginning and ending values). I have sort of set of methods in mind... But I am afraid it will probably change as I implement all the stuff. |
Okay, I am getting a clearer picture of it now. It seems then that NSTATES in the integrator corresponds to the total number of objects (bodies, rods, points, lines) in the system. The hierarchy below that (State structure and StateVar structures) make sense now. I do like that this will make things easily adaptable, I was actually planning to go in and clean up the line failures feature soon too to bring it up to speed with what I have on the MD-F side of things.
So does this mean the state structure will be the same regardless of the instance, but just some values will be empty? I.e. will a body have sub-spring and viv phase states that are just unused? My first impression here was that each state can have a custom set of StateVars.
I'm still not sure how this will work out because every state needs a corresponding derivative, but I trust you have something good in mind.
As they always do 🥲. This approach seems good to me if you have time to work on it. I am curious to hear if @AlexWKinley wants to chime in, especially with regards to #269. |
Hey guys! Sorry for the delay, I got swamped with other stuff. I am addressing this task now, and let's where I am landing. @RyanDavies19, on your diagram NSTATES is the number of states required by the Time integrator --so far as it happens now-- |
New Features
I am opening up this draft PR to get the conversation going on the best way to add new states. This is a WIP, the tests are currently failing. This work contains two new features:
The documentation updates reflect the input file changes that enable these new features. Other minor changes are:
State Approach
Prior to the improvements to states made by Alex things were working well, since then I have been fighting with failing tests in what seems to be allocation issues for this hackish misc state approach. Rather than continue to bang my head against a wall on something that will probably change, I figured it would be better to discuss approaches first with you all because you have a better sense of how this backend state stuff has been set up. Ideally we would include these two additional states in the line state structure, as they are unique to the lines. This is difficult to do without creating unused states, because the code is currently pretty rigidly structured around the
pos
,vel
, andacc
structures for each state (I.e. overloaded operators, implicit integration schemes, stationary solver,StateVar
andStateVarDeriv
classes). What we need to discuss is how we can adjust this so additional states can be added to objects without needing to completely rework the code each time. One approach I was considering is adjusting the vector lengths of the existing pos, velocity, and acc structures to accommodate these states. For example, in this case with lines.LineState.pos
would be a vector of 5 element vectors, andDLineStateDt.vel
would be a vector of 5 element vectors. We would then map the integrations of the first 3 components to the traditional approach ofacc
->vel
->pos
, and each time step also integrate the additional states held inDLineStateDt.vel
. However, this approach isn’t foolproof because there is no check to ensure that the contents ofDLineStateDt.vel
andLineState.pos
are in the right order. If we don’t want to leverage these existing structures then we will probably need to restructure a lot of the existing state and time code.This addresses the conversation started in #261 and #269 (comment). @AlexWKinley and @sanguinariojoe let me know your thoughts.
TODO: