- Forum
- Public Forums
- Finite Element Modelling - Code_Aster
- Script to calculate a deformation with a rotating force vector.
Script to calculate a deformation with a rotating force vector.
- Patufet
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 12
- Thank you received: 0
15 years 3 months ago #3998
by Patufet
Replied by Patufet on topic Re:Script to calculate a deformation with a rotating force vector.
Hello Kees,
What the Doc says is:
I don't understand very well neither why if all the commands are analysed before execution DEFI_LIST_REEL returns an error...
I just installed CA 10.1 as I thought that perhaps the command was not supported by the version that I use.
Now I will continue with the tests...
Thanks again for your great help!
What the Doc says is:
PAR_LOT =
Way the commands are treated:
'OUI': (default); superviser analyses all the commands before asking the execution.
'NON': after analysing one command the supervisor asks for it's execution and then analyses (and executes) the next command (treatment command by command).
I don't understand very well neither why if all the commands are analysed before execution DEFI_LIST_REEL returns an error...
I just installed CA 10.1 as I thought that perhaps the command was not supported by the version that I use.
Now I will continue with the tests...
Thanks again for your great help!
- Patufet
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 12
- Thank you received: 0
15 years 3 months ago #4004
by Patufet
Replied by Patufet on topic Re:Script to calculate a deformation with a rotating force vector.
Hello,
My script is now working OK.
As the Force is not applied directly near the weak part of the structure, to limit the size of the mesh, I have tried to use: LIAISON_SOLIDE as described in:
www.caelinux.org/wiki/index.php/Contrib:.../10_1_x_cases/torque
I apply a force to a single node with:
[code:1]AFFE_CHAR_MECA(MODELE=MODE,
FORCE_NODALE=_F(GROUP_NO=('F_Point',),
FX=AMPLITUDE,),);[/code:1]
The node F_Point is included in the group of nodes 'Top_F':
[code:1]LIA=AFFE_CHAR_MECA(MODELE=MODE,
LIAISON_SOLIDE=_F(GROUP_NO='Top_F',),);[/code:1]
It seems that the AMPLITUDE force applied to 'F_Point' is then distributed on the other nodes of Top_F. The effective charge applied to 'F_Point' seems to be AMPLITUDE/Surface('Top_F').
Should it be like that?
Here it is the CA script.
[code:1]
DEBUT(PAR_LOT='NON'); # needed to avoid an error at DEFI_LIST_REEL
import Numeric
AMPLITUDE=1; # amplitude in N
PI=Numeric.pi; # Pi
# divided into tsteps
step = 45; ## step in degrees
tend = 360; ## end angle
print 'step: ',step
print 'tend: ',tend
time=DEFI_LIST_REEL(DEBUT=0.0,
INTERVALLE=_F(JUSQU_A=tend-step,PAS=step,),
INFO=2,TITRE='Angle',);
lenTime = len(time.Valeurs());
#Cos values for angles from 0 to 'tend'-'step' in steps of 'step'
fcs = DEFI_LIST_REEL(INFO=2,TITRE='cos ',VALE = [(Numeric.cos(ii*step*PI/180.0)) for ii in range(0,lenTime)], )
#Sin values for angles from 0 to 'tend'-'step' in steps of 'step'
fsn = DEFI_LIST_REEL(INFO=2,TITRE='sin ',VALE = [(Numeric.sin(ii*step*PI/180.0)) for ii in range(0,lenTime)], )
rampx = DEFI_FONCTION(NOM_PARA='INST',
VALE_PARA=time,
VALE_FONC=fcs,
PROL_DROITE = 'CONSTANT',
PROL_GAUCHE = 'CONSTANT',
INFO=2, # nice to check the values
TITRE='rampx',);
rampy = DEFI_FONCTION(NOM_PARA='INST',
VALE_PARA=time,
VALE_FONC=fsn,
PROL_DROITE = 'CONSTANT',
PROL_GAUCHE = 'CONSTANT',
INFO=2, # nice to check the values
TITRE='rampy',);
MA=DEFI_MATERIAU(ELAS=_F(E=100e3,
NU=0.300,),); # E in MPa
MESH=LIRE_MAILLAGE(FORMAT='MED',);
MAIL=CREA_MAILLAGE(MAILLAGE=MESH,
CREA_POI1=_F(NOM_GROUP_MA='F_Point',
GROUP_NO='F_Point',),);
MODE=AFFE_MODELE(MAILLAGE=MAIL,
AFFE=(_F(TOUT='OUI',
PHENOMENE='MECANIQUE',
MODELISATION='3D',),
_F(GROUP_MA='F_Point',
PHENOMENE='MECANIQUE',
MODELISATION='DIS_TR',),),);
MATE=AFFE_MATERIAU(MAILLAGE=MAIL,
AFFE=_F(TOUT='OUI',
MATER=MA,),);
CARA=AFFE_CARA_ELEM(MODELE=MODE,
DISCRET=_F(CARA='K_TR_D_N',
GROUP_MA='F_Point',
VALE=(1.0,1.0,1.0,1.0,1.0,1.0,),),);
# Boundary conditions: Fixed side
ENCAS=AFFE_CHAR_MECA(MODELE=MODE,
DDL_IMPO=_F(GROUP_MA='Base',
DX=0,
DY=0,
DZ=0,),);
# X Component of the rotating Force Vector
F_x=AFFE_CHAR_MECA(MODELE=MODE,
FORCE_NODALE=_F(GROUP_NO=('F_Point',),
FX=AMPLITUDE,),);
# Y Component of the rotating Force Vector
F_y=AFFE_CHAR_MECA(MODELE=MODE,
FORCE_NODALE=_F(GROUP_NO=('F_Point',),
FY=AMPLITUDE,),);
# Top_F containts F_Point node (point wher F is applied) and the top Face nodes
LIA=AFFE_CHAR_MECA(MODELE=MODE,
LIAISON_SOLIDE=_F(GROUP_NO='Top_F',),);
RESU=MECA_STATIQUE(MODELE=MODE,
CHAM_MATER=MATE,
LIST_INST=time,
INFO=2,
CARA_ELEM=CARA,
EXCIT=(_F(CHARGE=ENCAS),
_F(CHARGE=F_x,FONC_MULT=rampx,),
_F(CHARGE=F_y,FONC_MULT=rampy,),
_F(CHARGE=LIA),),
OPTION='SIEF_ELGA_DEPL',);
RESU=CALC_ELEM(reuse =RESU,
MODELE=MODE,
CHAM_MATER=MATE,
RESULTAT=RESU,
OPTION=('SIGM_ELNO_DEPL','EQUI_ELNO_SIGM',),
EXCIT=(_F(CHARGE=ENCAS),
_F(CHARGE=F_x,FONC_MULT=rampx,),
_F(CHARGE=F_y,FONC_MULT=rampy,),
_F(CHARGE=LIA),),);
RESU=CALC_NO(reuse =RESU,
RESULTAT=RESU,
OPTION=('SIGM_NOEU_DEPL','EQUI_NOEU_SIGM',),);
# define table TB_disp
TB_Z=POST_RELEVE_T(ACTION=(_F(OPERATION='EXTRACTION',
INTITULE='Displacements',
RESULTAT=RESU,
NOM_CHAM='DEPL',
TOUT_ORDRE='OUI',
GROUP_NO='POS',
NOM_CMP=('DZ',),),),
TITRE='DZ',);
# print displacements to file
IMPR_TABLE(TABLE=TB_Z,
FORMAT='TABLEAU',
UNITE=8,
SEPARATEUR=' * ',
TITRE='Displacements Z at POS',);
IMPR_RESU(FORMAT='MED',
UNITE=80,
RESU=_F(MAILLAGE=MAIL,
RESULTAT=RESU,
NOM_CHAM=('SIGM_NOEU_DEPL','EQUI_NOEU_SIGM','DEPL',),),);
FIN();
[/code:1]<br /><br />Post edited by: Patufet, at: 2010/03/20 18:32
My script is now working OK.
As the Force is not applied directly near the weak part of the structure, to limit the size of the mesh, I have tried to use: LIAISON_SOLIDE as described in:
www.caelinux.org/wiki/index.php/Contrib:.../10_1_x_cases/torque
I apply a force to a single node with:
[code:1]AFFE_CHAR_MECA(MODELE=MODE,
FORCE_NODALE=_F(GROUP_NO=('F_Point',),
FX=AMPLITUDE,),);[/code:1]
The node F_Point is included in the group of nodes 'Top_F':
[code:1]LIA=AFFE_CHAR_MECA(MODELE=MODE,
LIAISON_SOLIDE=_F(GROUP_NO='Top_F',),);[/code:1]
It seems that the AMPLITUDE force applied to 'F_Point' is then distributed on the other nodes of Top_F. The effective charge applied to 'F_Point' seems to be AMPLITUDE/Surface('Top_F').
Should it be like that?
Here it is the CA script.
[code:1]
DEBUT(PAR_LOT='NON'); # needed to avoid an error at DEFI_LIST_REEL
import Numeric
AMPLITUDE=1; # amplitude in N
PI=Numeric.pi; # Pi
# divided into tsteps
step = 45; ## step in degrees
tend = 360; ## end angle
print 'step: ',step
print 'tend: ',tend
time=DEFI_LIST_REEL(DEBUT=0.0,
INTERVALLE=_F(JUSQU_A=tend-step,PAS=step,),
INFO=2,TITRE='Angle',);
lenTime = len(time.Valeurs());
#Cos values for angles from 0 to 'tend'-'step' in steps of 'step'
fcs = DEFI_LIST_REEL(INFO=2,TITRE='cos ',VALE = [(Numeric.cos(ii*step*PI/180.0)) for ii in range(0,lenTime)], )
#Sin values for angles from 0 to 'tend'-'step' in steps of 'step'
fsn = DEFI_LIST_REEL(INFO=2,TITRE='sin ',VALE = [(Numeric.sin(ii*step*PI/180.0)) for ii in range(0,lenTime)], )
rampx = DEFI_FONCTION(NOM_PARA='INST',
VALE_PARA=time,
VALE_FONC=fcs,
PROL_DROITE = 'CONSTANT',
PROL_GAUCHE = 'CONSTANT',
INFO=2, # nice to check the values
TITRE='rampx',);
rampy = DEFI_FONCTION(NOM_PARA='INST',
VALE_PARA=time,
VALE_FONC=fsn,
PROL_DROITE = 'CONSTANT',
PROL_GAUCHE = 'CONSTANT',
INFO=2, # nice to check the values
TITRE='rampy',);
MA=DEFI_MATERIAU(ELAS=_F(E=100e3,
NU=0.300,),); # E in MPa
MESH=LIRE_MAILLAGE(FORMAT='MED',);
MAIL=CREA_MAILLAGE(MAILLAGE=MESH,
CREA_POI1=_F(NOM_GROUP_MA='F_Point',
GROUP_NO='F_Point',),);
MODE=AFFE_MODELE(MAILLAGE=MAIL,
AFFE=(_F(TOUT='OUI',
PHENOMENE='MECANIQUE',
MODELISATION='3D',),
_F(GROUP_MA='F_Point',
PHENOMENE='MECANIQUE',
MODELISATION='DIS_TR',),),);
MATE=AFFE_MATERIAU(MAILLAGE=MAIL,
AFFE=_F(TOUT='OUI',
MATER=MA,),);
CARA=AFFE_CARA_ELEM(MODELE=MODE,
DISCRET=_F(CARA='K_TR_D_N',
GROUP_MA='F_Point',
VALE=(1.0,1.0,1.0,1.0,1.0,1.0,),),);
# Boundary conditions: Fixed side
ENCAS=AFFE_CHAR_MECA(MODELE=MODE,
DDL_IMPO=_F(GROUP_MA='Base',
DX=0,
DY=0,
DZ=0,),);
# X Component of the rotating Force Vector
F_x=AFFE_CHAR_MECA(MODELE=MODE,
FORCE_NODALE=_F(GROUP_NO=('F_Point',),
FX=AMPLITUDE,),);
# Y Component of the rotating Force Vector
F_y=AFFE_CHAR_MECA(MODELE=MODE,
FORCE_NODALE=_F(GROUP_NO=('F_Point',),
FY=AMPLITUDE,),);
# Top_F containts F_Point node (point wher F is applied) and the top Face nodes
LIA=AFFE_CHAR_MECA(MODELE=MODE,
LIAISON_SOLIDE=_F(GROUP_NO='Top_F',),);
RESU=MECA_STATIQUE(MODELE=MODE,
CHAM_MATER=MATE,
LIST_INST=time,
INFO=2,
CARA_ELEM=CARA,
EXCIT=(_F(CHARGE=ENCAS),
_F(CHARGE=F_x,FONC_MULT=rampx,),
_F(CHARGE=F_y,FONC_MULT=rampy,),
_F(CHARGE=LIA),),
OPTION='SIEF_ELGA_DEPL',);
RESU=CALC_ELEM(reuse =RESU,
MODELE=MODE,
CHAM_MATER=MATE,
RESULTAT=RESU,
OPTION=('SIGM_ELNO_DEPL','EQUI_ELNO_SIGM',),
EXCIT=(_F(CHARGE=ENCAS),
_F(CHARGE=F_x,FONC_MULT=rampx,),
_F(CHARGE=F_y,FONC_MULT=rampy,),
_F(CHARGE=LIA),),);
RESU=CALC_NO(reuse =RESU,
RESULTAT=RESU,
OPTION=('SIGM_NOEU_DEPL','EQUI_NOEU_SIGM',),);
# define table TB_disp
TB_Z=POST_RELEVE_T(ACTION=(_F(OPERATION='EXTRACTION',
INTITULE='Displacements',
RESULTAT=RESU,
NOM_CHAM='DEPL',
TOUT_ORDRE='OUI',
GROUP_NO='POS',
NOM_CMP=('DZ',),),),
TITRE='DZ',);
# print displacements to file
IMPR_TABLE(TABLE=TB_Z,
FORMAT='TABLEAU',
UNITE=8,
SEPARATEUR=' * ',
TITRE='Displacements Z at POS',);
IMPR_RESU(FORMAT='MED',
UNITE=80,
RESU=_F(MAILLAGE=MAIL,
RESULTAT=RESU,
NOM_CHAM=('SIGM_NOEU_DEPL','EQUI_NOEU_SIGM','DEPL',),),);
FIN();
[/code:1]<br /><br />Post edited by: Patufet, at: 2010/03/20 18:32
- Claus
-
- Offline
- Moderator
-
Less
More
- Posts: 670
- Thank you received: 34
15 years 3 months ago #4005
by Claus
Code_Aster release : STA11.4 on OpenSUSE 12.3 64 bits - EDF/Intel version
Replied by Claus on topic Re:Script to calculate a deformation with a rotating force vector.
Yes, your assumption is correct. The force applied to the single node is distributed to all the nodes, so if the node group of the surface consists of say 10 nodes, you have to multiply the force applied to the single node, by 10.
Perhaps I should make a small note of it on the wiki.
/C
Perhaps I should make a small note of it on the wiki.
/C
Code_Aster release : STA11.4 on OpenSUSE 12.3 64 bits - EDF/Intel version
- kwou
-
- Offline
- Moderator
-
15 years 3 months ago #4006
by kwou
Interest: structural mechanics, solar energy (picture at 'my location' shows too little pv panels)
--
kind regards - kees
Replied by kwou on topic Re:Script to calculate a deformation with a rotating force vector.
Hoi Patufet, Claus
I do not fully understand this last remark:
if you have a bunch of say 10 nodes collected in the a group F10 by LIAISSON_SOLIDE(....) and you apply a force Fone to one of them by FORCE_NODALE=_F(GROUP_NO=('Fone',),FX=1.0, ...), then the total force on Fone is 1.0/10 = 0.1. And the total force applied to the system is? Ftotal = F10 = 1.0 or just 0.1?
I guess that is why I try to a avoid to apply forces on nodes.
Anyway - kind regards - kees
I do not fully understand this last remark:
if you have a bunch of say 10 nodes collected in the a group F10 by LIAISSON_SOLIDE(....) and you apply a force Fone to one of them by FORCE_NODALE=_F(GROUP_NO=('Fone',),FX=1.0, ...), then the total force on Fone is 1.0/10 = 0.1. And the total force applied to the system is? Ftotal = F10 = 1.0 or just 0.1?
I guess that is why I try to a avoid to apply forces on nodes.
Anyway - kind regards - kees
Interest: structural mechanics, solar energy (picture at 'my location' shows too little pv panels)
--
kind regards - kees
- Claus
-
- Offline
- Moderator
-
Less
More
- Posts: 670
- Thank you received: 34
15 years 3 months ago #4007
by Claus
Code_Aster release : STA11.4 on OpenSUSE 12.3 64 bits - EDF/Intel version
Replied by Claus on topic Re:Script to calculate a deformation with a rotating force vector.
Kees Wouters wrote:
www.caelinux.org/wiki/index.php/Image:Claws_applying_torgue.png
If you were to apply FX=5N, each node would receive 1N.
Post edited by: Claus, at: 2010/03/20 21:49<br /><br />Post edited by: Claus, at: 2010/03/20 21:49
Hoi Patufet, Claus
I do not fully understand this last remark:
if you have a bunch of say 10 nodes collected in the a group F10 by LIAISSON_SOLIDE(....) and you apply a force Fone to one of them by FORCE_NODALE=_F(GROUP_NO=('Fone',),FX=1.0, ...), then the total force on Fone is 1.0/10 = 0.1. And the total force applied to the system is? Ftotal = F10 = 1.0 or just 0.1?
I guess that is why I try to a avoid to apply forces on nodes.
Anyway - kind regards - kees
www.caelinux.org/wiki/index.php/Image:Claws_applying_torgue.png
If you were to apply FX=5N, each node would receive 1N.
Post edited by: Claus, at: 2010/03/20 21:49<br /><br />Post edited by: Claus, at: 2010/03/20 21:49
Code_Aster release : STA11.4 on OpenSUSE 12.3 64 bits - EDF/Intel version
- Patufet
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 12
- Thank you received: 0
15 years 3 months ago #4008
by Patufet
Replied by Patufet on topic Re:Script to calculate a deformation with a rotating force vector.
Claus,
thank you for your reply. It seems to me than more than the number of nodes it is the surface itself. To obtain the expected displacement I had to apply the force:
AMPLITUDE/Surface(Top_F) instead of AMPLITUDE.
In my test I applied 1N and expected a displacement of 0.2 mm. I obtained instead a displacement of about 0.128 mm, the surface of Top_F being 0.8x0.8=0.64 mm^2.
The number of nodes of Top_F (excluding F_Point) was 225 in my test.
Regards.<br /><br />Post edited by: Patufet, at: 2010/03/20 22:09
thank you for your reply. It seems to me than more than the number of nodes it is the surface itself. To obtain the expected displacement I had to apply the force:
AMPLITUDE/Surface(Top_F) instead of AMPLITUDE.
In my test I applied 1N and expected a displacement of 0.2 mm. I obtained instead a displacement of about 0.128 mm, the surface of Top_F being 0.8x0.8=0.64 mm^2.
The number of nodes of Top_F (excluding F_Point) was 225 in my test.
Regards.<br /><br />Post edited by: Patufet, at: 2010/03/20 22:09
Moderators: catux
- Forum
- Public Forums
- Finite Element Modelling - Code_Aster
- Script to calculate a deformation with a rotating force vector.
Time to create page: 0.165 seconds