Salome:
Starting with a 3D mesh first you need to create a 1 D element (edge), where the spring is supposed to be.
- If you need a spring an ground, place a new node and then create a new edge between the "ground" and the desired node of your model. To block displacements of the ground-node later in Code-Aster, it is useful to create a group containing all these fixed nodes.
- If you need a spring only connected with existing nodes, just create a edge between the nodes you need
I order to assign a stiffness to the just created spring in Code-Aster, create a group of the new spring ("spring"). To pick the element, not the nodes, select "Elements type: Edge"
Code-Aster:
Within Code-Aster the model has to know about the discrete spring. This is done with "AFFE_MODELE", where the "spring"group is defined as a discrete and translational. If you need rotational as well, choose "MODELISATION -> DIS_TR"
modele=AFFE_MODELE(MAILLAGE=mesh,
AFFE=(_F(TOUT='OUI',
PHENOMENE='MECANIQUE',
MODELISATION='3D',),
_F(GROUP_MA='spring',
PHENOMENE='MECANIQUE',
MODELISATION='DIS_T',),),);
The properties of the spring are described with "AFFE_CARA_ELEM". In this case the spring has only translational degrees of freedom, which can be defined by the element "K_T_D_L" (be sure to use any of the "T" elements, not "TR"). Because we use a SEG2 entity, we also need the "L", not "N".
cara=AFFE_CARA_ELEM(MODELE= modele,
DISCRET=(_F(CARA='K_T_D_L',
GROUP_MA='spring',
VALE=(25000,25000,25000,),),);
If you need rotation as well, choose e.g. "K_TR_D_L".
If you need a spring on ground, now you could tie the free end of your spring with "AFFE_CHAR_MECA / DDL_IMPO" and finish your calculation.
! Don't forget to put your spring definition ("cara") everywhere it's in need !
e.g.:
MACRO_MATR_ASSE(MODELE= modele,
CHAM_MATER=mat,
CARA_ELEM=cara, ...
or the solver:
dyna=DYNA_LINE_TRAN(MODELE=modell,
CHAM_MATER=mat,
CARA_ELEM=cara,
MATR_MASS=Mmass, ...