Apply known temperature distribution along axis to use temp. based material properties

I want to use temperature-based material properties in a 2D analysis. If the temperature distribution is known to vary along a direction (for instance linear temperature distribution along y-axis), is it possible to apply this temperature field with CalculiX?

image

If it’s a static analysis, you can use the *TEMPERATURE keyword but it has to be specified per node or read from .frd file with results of a previous (thermal) analysis.

1 Like

You can try a user subroutine, I think utemp.f , that provides a way to do this for *BOUNDARY, USER and degree of freedom 11.

The utemp.f subroutine can also be used with the *TEMPERATURE keyword in purely mechanical analyses. But subroutines are usually used as a last resort. It’s often possible to avoid them with some more or less tedious workarounds. Here you could obtain such a temperature field in a heat transfer analysis or partition the model and apply spatially varying temperatures manually.

1 Like

@Calc_em and @jbr thank you for the suggestions. Unfortunately, I am not familiar with utemp.f. Since this is an f file, would one need to recompile CalculiX? Or you can just write the file and submit it along within the .inp file. With *TEMPERATURE keyword, I understand that it is possible to define a single temperature value for a node, or a node set. In my case, however, I want to apply a temperature to each node based on one of its coordinates, its y-coordinate for instance.

As a possible workaround using *TEMPERATURE keyword: I can export all nodes and their coordinates to a file (nodes.msh). With a Python code, I can grab each node’s ID, and its y coordinate from this file (nodes.msh) and write another file containing the temperatures:

temperatures.txt

1, 25
2,26
.
.
.
300, 473

But I am not sure if can I use this file in the .inp file like *TEMPERATURE,FILE=temperatures.txt.
I can try and see.

If you have any further suggestions, I would be more than happy to have them. Thank you again.

Unfortunately, recompilation is necessary:

To use a user subroutine, replace the dummy routine in the CalculiX distribution by yours (e.g. dflux.f from the distribution by the dflux.f you wrote yourself) and recompile.

The FILE parameter is for reading from .frd file from a previous analysis. But you can just paste the generated data (node number, temperature at a node) in lines under this keyword.

Thank you @Calc_em . I believe I can do this. For larger models, though, this would make the .inp somewhat unreadable :smiley: I guess maybe, *INCLUDE keyword can be useful in this case, for clarity.

*INCLUDE, INPUT = temperatures.txt

*TEMPERATURE
1, 25
2,26
.
.
.
300, 473

I appreciate the help. Thanks!

Sure, you can always use the *INCLUDE keyword in such cases. I prefer to have everything in one place and just fold the large portions with many lines when reading the file but many people use includes. Especially when working with preprocessors like GraphiX.

1 Like

Hello again. I tried this and get the following error:

*ERROR reading *TEMPERATURE: a *TEMPERATURE
   card is detected but no thermal
   *INITIAL CONDITIONS are given

Following is my input file:

*INCLUDE, INPUT = nodes.msh
*INCLUDE, INPUT = axi.msh
*INCLUDE, INPUT = symm_BC.nam 
*INCLUDE, INPUT = press.sur

*BOUNDARY
Nsymm_BC,2,2

*ELSET,ELSET=Eall
Eaxi

** Temperature based material data.
*INCLUDE, INPUT = MAT_DEMO_1.nam 

*SOLID SECTION,ELSET=Eaxi,MATERIAL=MatAxi

*STEP, NLGEOM
*STATIC
** Node temperatures read from a file within a *STATIC step.
*INCLUDE, INPUT = temperatures.nam
*DSLOAD
Spress, P, -20
*DLOAD
Eall,CENTRIF,3000000,0.,0.,0.,0.,1.,0.
*NODE PRINT,NSET=Nall
U
*EL PRINT,ELSET=Eall
S
*EL FILE
U,S
*END STEP

The manual states that

*TEMPERATURE should not be used within a pure thermal or combined thermome-
chanical analysis.

But in my case it is a static step. Any suggestions?

Just add *INITIAL CONDITIONS to define the initial temperature, as the error message suggests.

1 Like

Thank you @Calc_em, for the prompt insight! I think I implicitly assumed initial temp. wouldn’t be needed since I am not interested in thermal stresses (for this case, but later I will most likely need this). I added room temp. as initial cond. and it works.

CalculiX requires initial temperature definition whenever temperatures are involved so in steady-state and transient heat transfer and coupled temperature-displacement analyses but also when temperatures are applied in a static step. It doesn’t just assume T_0=0 like Abaqus.

2 Likes