Hello,
I'm currently working on a thermo-mechanical analysis of a heat exchanger piping. The thermal CFD analysis using Code_Saturne has been completed, and I now want to use its results (i.e., the temperature field) in Salome_Meca/Code_Aster for the mechanical analysis.
However, I’m encountering issues when attempting to import the CFD temperature results from Saturne into Code_Aster.
Here is an excerpt from my Code_Aster input file :
mesh = LIRE_MAILLAGE(NOM_MED='Solid_med',
UNITE=2)
model = AFFE_MODELE(AFFE=F(MODELISATION='3D',
PHENOMENE='THERMIQUE',
TOUT='OUI'),
GRANDEUR_CARA=F(),
MAILLAGE=mesh)
listr = DEFI_LIST_REEL(VALE=(1.0, ))
myoung = DEFI_FONCTION(NOM_PARA='TEMP',
PROL_DROITE='CONSTANT',
PROL_GAUCHE='CONSTANT',
VALE=(150.0, 189000000000.0, 750.0, 138000000000.0))
NU = DEFI_CONSTANTE(VALE=0.3)
Rho = DEFI_CONSTANTE(VALE=8000.0)
alpha = DEFI_FONCTION(NOM_PARA='TEMP',
PROL_DROITE='CONSTANT',
PROL_GAUCHE='CONSTANT',
VALE=(150.0, 16.2, 200.0, 16.6, 250.0, 16.9, 300.0, 17.2, 350.0, 17.5, 400.0, 17.8, 450.0, 18.0, 500.0, 18.3, 550.0, 18.5, 600.0, 18.7, 650.0, 18.9, 700.0, 19.0, 750.0, 19.2))
acier = DEFI_MATERIAU(ELAS_FO=F(ALPHA=alpha,
E=Rho,
NU=NU,
RHO=Rho,
TEMP_DEF_ALPHA=273.0),
THER=F(LAMBDA=50.2))
#comment: field0 = LIRE_CHAMP(MAILLAGE=mesh,
#comment: NOM_CMP_IDEM='OUI',
#comment: NOM_MED='TempC',
#comment: TYPE_CHAM='NOEU_TEMP_R',
#comment: UNITE=81)
#comment: loadtran = LIRE_RESU(FORMAT='MED',
#comment: FORMAT_MED=_F(NOM_CHAM='TEMP',
#comment: NOM_CHAM_MED='TempC'),
#comment: MAILLAGE=mesh,
#comment: TOUT_ORDRE='OUI',
#comment: TYPE_RESU='EVOL_THER',
#comment: UNITE=81)
field = LIRE_CHAMP(MAILLAGE=mesh,
NOM_CMP_IDEM='OUI',
NOM_MED='TempC',
TYPE_CHAM='NOEU_TEMP_R',
UNITE=2)
The MED file linked to UNITE=2 (results_med.med) contains the CFD thermal results exported from Saturne.
When I attempt to run the simulation, I get the following error :
╔════════════════════════════════════════════════════════════════════════════════════════════════╗
║ <EXCEPTION> <MED_41> ║
║ ║
║ Erreur à la lecture du maillage. ║
║ ║
║ Exception : ║
║ Traceback (most recent call last): ║
║ File "/opt/salome_meca/V2024.1 ║
║ 0_scibian_univ/tools/Code_aster_stable-1670/lib/aster/code_aster/ObjectsExt/mesh_builder.py", ║
║ line 51, in wrapper ║
║ result = func(args, **kwds) ║
║ File "/opt/salome_meca/V2024.1 ║
║ 0_scibian_univ/tools/Code_aster_stable-1670/lib/aster/code_aster/ObjectsExt/mesh_builder.py", ║
║ line 86, in buildFromMedFile ║
║ mreader.buildMesh(mesh, verbose) ║
║ File "/opt/salome_meca/V2024.1 ║
║ 0_scibian_univ/tools/Code_aster_stable-1670/lib/aster/code_aster/ObjectsExt/medctoaster.py", ║
║ line 134, in buildMesh ║
║ self.parse(mesh) ║
║ File "/opt/salome_meca/V2024.1 ║
║ 0_scibian_univ/tools/Code_aster_stable-1670/lib/aster/code_aster/ObjectsExt/medctoaster.py", ║
║ line 216, in parse ║
║ self.parseMesh() ║
║ File "/opt/salome_meca/V2024.1 ║
║ 0_scibian_univ/tools/Code_aster_stable-1670/lib/aster/code_aster/ObjectsExt/medctoaster.py", ║
║ line 259, in parseMesh ║
║ mesh_current_type = medc.MEDCoupling1SGTUMesh(mesh_level[cells_current_type]) ║
║ File "/opt/salome_meca/V2024.1 ║
║ 0_scibian_univ/prerequisites/Cea_archive-9120/BINARIES-DB11/MEDCOUPLING/lib/python3 ║
║ 9/site-packages/medcoupling.py", line 11839, in init ║
║ _medcoupling.MEDCoupling1SGTUMesh_swiginit(self, ║
║ _medcoupling.new_MEDCoupling1SGTUMesh(args)) ║
║ medcoupling.InterpKernelException: MEDCoupling1SGTUMesh::New : the input geometric type ║
║ NORM_POLYGON is dynamic ! Only static types are allowed here ! ║
I understand from this error that the mesh format (NORM_POLYGON) used by Code_Saturne is not compatible with Code_Aster, which only accepts static geometric types.
To troubleshoot, I tried using an alternative mesh (maillage_f) but then encountered a different error :
╔════════════════════════════════════════════════════════════════════════════════════════════════╗
║ <EXCEPTION> <MED_54> ║
║ ║
║ -> Le maillage fourni à la commande n'est pas cohérent avec le type de structure ║
║ de données résultat que vous souhaitez produire. ║
║ ║
║ Les éléments du modèle fourni ont pour support géométrique des ║
║ mailles ne figurant pas dans le fichier MED. ║
║ Par exemple, il y a 0 mailles de type SEG2 dans le fichier MED, ║
║ alors que le modèle en contient 27272. ║
║ -> Risque & Conseil : ║
║ Veuillez fournir un modèle dont le maillage correspond à celui présent ║
║ dans le fichier MED. ║
╚════════════════════════════════════════════════════════════════════════════════════════════════╝
From this, I gather that 1D elements expected by the model are missing from the MED file used to import the result.
Summary of My Setup:
• Salome_Meca Version: 2024
• Code_Saturne Version: 2017
Questions:
Is there a recommended way to export static-type MED files from Code_Saturne that are compatible with Code_Aster ?
Thank you in advance for your help.
Best regards,
Lauris