Welcome to the forums. Please post in English or French.

You are not logged in.

#1 2016-01-10 16:13:27

stephaneberger
Member
From: Strasbourg (France)
Registered: 2012-10-15
Posts: 70

[SOLVED] Field manipulation - Combination of components

Hi everyone and Happy new year to the aster developpers and users.

I'm making thermo-metallo-mechanical simulation. Every thing is running well but I would want to postprocess the retain austenite amount which should be obtained by making a linear combination of fields given by calc_meta.
The point is I didn't find any notice on how to make a linear combination of field components.

In other words, from calc_meta, I obtain a field with the following components V1, V2, V3, V4 which are the amount of Ferrite, Pearlite, Bainite and Martensite.
I would want to create an other component Vn which is (1-V1-V2-V3-V4).
Can anyone could give me some advices or examples on how to proceed ?

An other point concerns the documention for all the possible field types. Does someone know if there is a notice which describe what are exactly and when to use the different CHAMP_GD, CHAMP_NO, CART_XXXX, NOEU_XXX, .... ?

Thank you for your help

Stephane

Last edited by stephaneberger (2016-01-31 00:16:52)

Offline

#2 2016-01-11 08:25:47

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 3,826

Re: [SOLVED] Field manipulation - Combination of components

hello

the following code abstract makes such a manipulation with beam stress results
using a user field, CHAM_UTIL

DEBUT(PAR_LOT='NON');

import numpy
............
stat=CALC_CHAMP(
	reuse =stat,RESULTAT=stat,  
	CONTRAINTE=('SIPO_ELNO',),
);

fsum = FORMULE(
	NOM_PARA=('SN','SMFY','SMFZ'),
	VALE="""numpy.sign(SN)*(abs(SN)+abs(SMFY)+abs(SMFZ))""",
);

stat=CALC_CHAMP(
	reuse =stat,RESULTAT=stat, 
	CHAM_UTIL=_F(
		NOM_CHAM='SIPO_ELNO',
		FORMULE=(fsum,),
		NUME_CHAM_RESU=1,
	),
	INFO=2,
);
........................
IMPR_RESU(
	MODELE=model,FORMAT='RESULTAT',
	RESU=_F(
		RESULTAT=stat, GROUP_MA=('topbeam',),
		NOM_CHAM='UT01_ELNO',NOM_CMP='X1',
		FORMAT_R='1PE12.3',VALE_MAX='OUI',VALE_MIN='OUI',
	),
);

jean pierre aubry


consider reading my book
freely available here https://framabook.org/beginning-with-code_aster/

Offline

#3 2016-01-12 07:10:23

P929
Member
From: Bogotá, CO
Registered: 2015-07-31
Posts: 111

Re: [SOLVED] Field manipulation - Combination of components

Hi,

I need to do something similar. I need to obtain the stresses of a calculation and apply a formula and use the result as one of the internal variables of the next calculation step.

If I have SIYY, SIXX, SIZZ, I need to find PCR such as:

 PCR=(SIXX+SIYY+SIZZ)/6 

and then use PCR as variable #1 of the internal variables field.

I'm pretty sure that it can be done, but how is the question. The only thing I know to do is to extract the stresses via

 SIG_EXC1=CREA_CHAMP(TYPE_CHAM='ELGA_SIEF_R',
                OPERATION='EXTR',
                RESULTAT=RES_EXC1,
                NOM_CHAM='SIEF_ELGA',
        	INST=1,
                ); 

But no idea about the creation of PCR and its use as internal variable. Any help is always welcome.

Cheers, Ferney

Offline

#4 2016-01-12 09:42:31

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 3,826

Re: [SOLVED] Field manipulation - Combination of components

hello

i  do not understand what you are trying to do
more information and maybe the .comm file would be helpful

particularly what is the use of this CREA_CHAMP as SIEF_ELGA can be directly extracted with CALC_CHAMP

jean pierre aubry


consider reading my book
freely available here https://framabook.org/beginning-with-code_aster/

Offline

#5 2016-01-12 14:11:19

P929
Member
From: Bogotá, CO
Registered: 2015-07-31
Posts: 111

Re: [SOLVED] Field manipulation - Combination of components

Hi Jean Pierre,

In fact, I haven't a functional .comm file yet. But I'll try to explain better what I need to do.

I'm using the Cam_Clay constitutive model. It requires an internal variable to be initialized with a precise value, which is half of the octahedral normal stress, which in turn, depends mainly on the depth of the soil.

If SIXX, SIYY, SIZZ are the stresses in X, Y, Z direction, respectively. Then the octahedral normal stress might be defined as:

 SIG_OCT=(SIXX+SIYY+SIZZ)/6 

So I need to create the initial stresses field (elastic calculation), and then calculate this SIG_OCT so finally it can be used as the variable # 1 of the internal variable of the CAM_CLAY material.

The CREA_CHAMP I posted above is something I use to get the stresses to be printed in the MED file, and I posted to verify that I'm aware that it's possible to obtain a field containing all the component of the stress tensor, but that I don't know how to manipulate the individual components in order to obtain the SIG_OCT.

In test SSNP136a they initialized the stresses in an analytical way, as well as the SIG_OCT (PCR in that test case). Unfortunately, this is only possible in some ideal cases, but in real cases the initial stresses can't be defined analytically. Therefore, an elastic calculation has to be made to define them and as a consequence, the SIG_OCT has to be calculated with formulas.

Thx and cheers, Ferney

Offline

#6 2016-01-13 05:45:29

P929
Member
From: Bogotá, CO
Registered: 2015-07-31
Posts: 111

Re: [SOLVED] Field manipulation - Combination of components

The best I could advance was to define this, based on what is written in page 33 of document [u4.81.04]:

 PCR3 = FORMULE (NOM_PARA= ("SIXX", "SIYY", "SIZZ"),
 VALE= """ (SIXX+SIYY+SIZZ)/6 """)
 
LMBO = CALC_CHAMP (reuse=RES_EXC1,
 RESULTAT=RES_EXC1,
 CHAM_UTIL=_F (NOM_CHAM=' SIGM_ELGA',
 FORMULE= (PCR3),
 NUME_CHAM_RESU=1,),) 

But I get the error Concept réutilisé : le nom de la variable de retour devrait être RES_EXC1 et non VARINI .

So, I guess I'm on the right track, but am I?

thx and cheers, Ferney


Attachments:
MCC.mess, Size: 10.34 KiB, Downloads: 293

Offline

#7 2016-01-13 07:29:29

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 3,826

Re: [SOLVED] Field manipulation - Combination of components

you are on the way

 Concept réutilisé : le nom de la variable de retour devrait être RES_EXC1 et non VARINI

i doubt this msg is related to the bit of code your are providing, it come from somewhere else in the code

with what you have done you can access the created variable  which is, as i explained earlier, the component "NOM_CMP='X1'" of the field "NOM_CHAM='UT01_ELNO'"


consider reading my book
freely available here https://framabook.org/beginning-with-code_aster/

Offline

#8 2016-01-18 22:08:56

stephaneberger
Member
From: Strasbourg (France)
Registered: 2012-10-15
Posts: 70

Re: [SOLVED] Field manipulation - Combination of components

Hi Jean-Pierre,

Sorry for the late reply, I was travelling in the world.
Thank you for the example, I'm going to try.
Just a question on your example. Why are you using PAR_LOT='NON' ?
(Up to now, I don't understand the benefit to execute sequentially the solve process).

@P929,
On the line :

LMBO = CALC_CHAMP (reuse=RES_EXC1,

souldn't be RES_EXC1 instead of LMBO ? To me you should write :

RES_EXC1 = CALC_CHAMP (reuse=RES_EXC1,

Stephane

Offline

#9 2016-01-19 09:55:21

jeanpierreaubry
Guru
From: nantes (france)
Registered: 2009-03-12
Posts: 3,826

Re: [SOLVED] Field manipulation - Combination of components

as we are exploring the Code_Aster result data base we have to use
DEBUT(PAR_LOT='NON')
you can try without but i do think it will work


consider reading my book
freely available here https://framabook.org/beginning-with-code_aster/

Offline

#10 2016-01-31 00:16:15

stephaneberger
Member
From: Strasbourg (France)
Registered: 2012-10-15
Posts: 70

Re: [SOLVED] Field manipulation - Combination of components

It works well

Thanks for your help

Stephane

Offline