-
Notifications
You must be signed in to change notification settings - Fork 24
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
materials dictionary in pymadl reader result #151
Comments
@germa89, this is an easy one. Please make this a high priority. |
It would really speed up the things if he could share |
I need more details, because running >>> from ansys.mapdl.core import launch_mapdl
>>> from ansys.mapdl.core.examples import vmfiles
>>> mapdl = launch_mapdl()
>>> mapdl.input(vmfiles['vm271'])
>>> import os
>>> from ansys.mapdl import reader
>>> result = reader.read_binary(os.path.join(mapdl.directory, 'file.rth'))
>>> mats = result.materials
>>> mats
{1: {'KXX': 1e-16, 'C': 0.5374}, 3: {'KXX': 10000.0}} |
Hi @germa89 Attached is a sample MAPDL thermal result file with temperature dependent properties. Mike The materials have temperature dependent thermal conductivity and electrical resistivity, but constant value other properties. So the output of the results.materials will look like: |
@germa89, feel free to use the example thermal file @mikerife provided here in #150 and include it in tests/testfiles. |
@germa89 Here is a simpler version of that rth file with one material model but the same two properties are temperature dependent. |
Ok, guys. Please download the link below. I think you'll see the problem... |
That is quite a big file. I'll be using @mikerife 's one for the unit tests. |
It seems to (partially) work. See thermal expansion coefficients. I unzipped the import os
from ansys.mapdl import reader
rth = r"C:\Users\gayuso\Downloads\sr_1390_mat_import\sr_1390_mat_import_files\dp0\SYS\MECH\file.rth"
result = reader.read_binary(rth)
mats = result.materials
mats Then I'm double checking some properties. Densitymats[1]['DENS']
Out[7]:
array([[ 23.88888889, 93.33333333, 204.44444444, 315.55555556,
426.66666667, 537.77777778],
[ 15.14041241, 14.70782919, 15.57299562, 15.14041241,
15.35670401, 15.14041241]]) Isotropic elasticityIn [8]: mats[1]['EX']
Out[8]:
array([[2.38888889e+01, 9.33333333e+01, 2.04444444e+02, 3.15555556e+02,
4.26666667e+02, 5.37777778e+02],
[1.58659579e+11, 1.51705345e+11, 1.56278224e+11, 1.47408713e+11,
1.44618804e+11, 1.37456782e+11]]) Specific heatIn [6]: mats[1]['C']
Out[6]:
array([[2.38888889e+01, 9.33333333e+01, 2.04444444e+02, 3.15555556e+02,
4.26666667e+02, 5.37777778e+02],
[1.15391104e+05, 1.15913937e+05, 1.28279898e+05, 1.28764077e+05,
1.34280990e+05, 1.37857159e+05]]) Thermal expansion
In [9]: mats[1]['ALPX']
Out[9]:
array([[2.38888889e+01, 9.33333333e+01, 2.04444444e+02, 3.15555556e+02,
4.26666667e+02, 5.37777778e+02],
[8.36075344e-06, 8.24988623e-06, 8.86577170e-06, 8.87778046e-06,
9.24162890e-06, 9.38963415e-06]]) This is different!! OthersThe rest of them, are the same. Only In [10]: mats[1]
Out[10]:
{'EX': array([[2.38888889e+01, 9.33333333e+01, 2.04444444e+02, 3.15555556e+02,
4.26666667e+02, 5.37777778e+02],
[1.58659579e+11, 1.51705345e+11, 1.56278224e+11, 1.47408713e+11,
1.44618804e+11, 1.37456782e+11]]),
'NUXY': array([[2.38888889e+01, 9.33333333e+01, 2.04444444e+02, 3.15555556e+02,
4.26666667e+02, 5.37777778e+02],
[3.00000000e-01, 3.00000000e-01, 3.00000000e-01, 3.00000000e-01,
3.00000000e-01, 3.00000000e-01]]),
'ALPX': array([[2.38888889e+01, 9.33333333e+01, 2.04444444e+02, 3.15555556e+02,
4.26666667e+02, 5.37777778e+02],
[8.36075344e-06, 8.24988623e-06, 8.86577170e-06, 8.87778046e-06,
9.24162890e-06, 9.38963415e-06]]),
'DENS': array([[ 23.88888889, 93.33333333, 204.44444444, 315.55555556,
426.66666667, 537.77777778],
[ 15.14041241, 14.70782919, 15.57299562, 15.14041241,
15.35670401, 15.14041241]]),
'KXX': array([[ 23.88888889, 93.33333333, 204.44444444, 315.55555556,
426.66666667, 537.77777778],
[ 6.86676143, 7.23487363, 8.79421257, 9.58342212,
10.90236955, 12.27092866]]),
'C': array([[2.38888889e+01, 9.33333333e+01, 2.04444444e+02, 3.15555556e+02,
4.26666667e+02, 5.37777778e+02],
[1.15391104e+05, 1.15913937e+05, 1.28279898e+05, 1.28764077e+05,
1.34280990e+05, 1.37857159e+05]])} Notes
|
Thinking about the possible reason for the differences between workbench and the reader... Thinking a bit out loud here. The first value is the same:
But then it start to diverge, it is like the "secant" has a different slope. The first value is also the closest to the reference temperature (20 in workbench, unknown in the reader), so if it is an issue with the temperature reference it makes sense that this first value match. |
I opened the The reader is right!! Interestingly, the reference temperature is blank. I believe Workbench is doing some conversion on the data when saved (maybe referencing the temp to 0), I really still don't see how that will change the slope... but I cannot really think any other reason (expect for a workbench bug). ExtraFor further info, the thermal coefficient expansion graph (Workbench data based) |
Hi @germa89 I'm OoO for a few days and will look into what WB and MAPDL are doing here when I get back. Mike |
Sure thing. No rush! |
Hi @germa89 @akaszynski @agrishin Well, all three programs are correct. We just need to look at the material data in a certain way. The material specific strain free temperature is given in the Engineering Data here: And TREF the general reference temperature is given here: Note that since thermal analyses do not use TREF, the command is not written to the input file. But it is on the structural model input file. Since the models 'MAT1' has different material specific and global strain free temperatures, MPAMOD is written which flags the solver to adjust the secant thermal expansion coefficients to match global strain free temperatures. See the MAPDL Help, theory guide equation 2-40. The adjustment is pretty small given the temperature difference of only 2 degrees C on the structural side. TREF defaults to zero if the command is not issued, so on the thermal analysis side the adjustment is a little bigger. Mike |
Great comment @mikerife. Thank you very much for your detailed work. I presume then we can conclude Reader data is correct and proceed to approve #150 @akaszynski |
Not sure if this is at all helpful, but check out the following:
https://www.padtinc.com/2017/07/11/secant-or-instantaneous-cte-understanding-thermal-expansion-modeling-ansys-mechanical/
Alex Grishin, PhD
Consulting Engineer
PADT, Inc.
|
Before submitting the issue
Description of the bug
Issuing the following:
results in the following materials dictionary after reading in thermal model
The materials in that model have temperature dependent properties.
Steps To Reproduce
See above
Which Operating System are you using?
No response
Which Python version are you using?
No response
PyMAPDL Report
Installed packages
The text was updated successfully, but these errors were encountered: