How to more easily export AcuProbe results from multiple simulations of SimLab? Also, what kind of r

Jorge_ceballos22
Jorge_ceballos22 Altair Community Member

Hello experts,

I've been running a large number of simulations in SimLab and need to export the AcuProbe results for each one. Currently, I have to open the log of each simulation and manually export the results, which takes me around 2 hours or more just for this task.

Here you can see a folder showing a quarter of the simulations I'm working on:

Also, when I use AcuProbe to export a variable, I do it manually for each simulation:

My question is: Is there a way to more easily export the AcuProbe results from multiple simulations?

The results I get directly from SimLab responses aren't helpful because I can only obtain the maximum or minimum value of the variable I need.

Additionally, I'd like to know what kind of results AcuProbe provides. Are they averages over all the elements of the surface or another type of result?

I believe that the results provided by AcuProbe are averages, because when I compare the results in SimLab with Query Results, and export the data and find the average of that variable in Excel, the results are very similar although not equal. I just want to be sure about what type of results they are.

I would greatly appreciate any help or suggestions!

Best Answer

  • acupro
    acupro
    Altair Employee
    Answer ✓

    You would want to use the command-line utility acuTrans to generate files with the integrated surface output variables - that you see under the Surface Output tree of AcuProbe. This is the Help page for acuTrans:

    https://help.altair.com/hwcfdsolvers/acusolve/topics/acusolve/post_processing_programs_acutrans.htm

    Table 7 on that page has the list of available integrated surface output quantities. Table 25 has the definitions for those integrated variables. Just above that table is description and an example of the acuTrans command to use with -osi to get integrated surface quantities. acuTrans -h gives the full list of options.

    If you have the HyperWorks CFD Solvers package installed, you can run acuTrans from the AcuSolve Command Prompt. ( Windows Start > Altair <version> > AcuSolve Cmd Prompt <version>

    If you only have SimLab installed, go to this location (default, so you may need to adjust if SimLab is installed in a different area):

    C:\Program Files\Altair\2024.1\SimLab\bin\win64\solvers\Acusolve\acusolve\win64\bin

    and double-click acusim.bat to open the AcuSolve Command Prompt.

Answers

  • acupro
    acupro
    Altair Employee
    Answer ✓

    You would want to use the command-line utility acuTrans to generate files with the integrated surface output variables - that you see under the Surface Output tree of AcuProbe. This is the Help page for acuTrans:

    https://help.altair.com/hwcfdsolvers/acusolve/topics/acusolve/post_processing_programs_acutrans.htm

    Table 7 on that page has the list of available integrated surface output quantities. Table 25 has the definitions for those integrated variables. Just above that table is description and an example of the acuTrans command to use with -osi to get integrated surface quantities. acuTrans -h gives the full list of options.

    If you have the HyperWorks CFD Solvers package installed, you can run acuTrans from the AcuSolve Command Prompt. ( Windows Start > Altair <version> > AcuSolve Cmd Prompt <version>

    If you only have SimLab installed, go to this location (default, so you may need to adjust if SimLab is installed in a different area):

    C:\Program Files\Altair\2024.1\SimLab\bin\win64\solvers\Acusolve\acusolve\win64\bin

    and double-click acusim.bat to open the AcuSolve Command Prompt.

  • Jorge_ceballos22
    Jorge_ceballos22 Altair Community Member

    Hello @acupro, thank you very much for your detailed response and for guiding me on how to use the acuTrans utility for extracting integrated surface results. Your assistance has been invaluable in streamlining my workflow. I would also like to share with the community the Python code I used to automate this process. This script iterates through multiple simulation directories, runs the necessary commands to export the results, assigns them custom filenames, and moves them to a centralised folder, saving time and effort:

    import os
    import shutil
    import subprocess
    
    # Listas de parámetros
    #dias = ['21-06-2023', '21-12-2023', '23-09-2023']
    #espaciamientos = ['0.50-m', '0.75-m', '1.00-m', '1.25-m', '1.50-m']
    #alineaciones = ['000 deg', '015 deg', '030 deg', '045 deg', '060 deg', '075 deg', '090 deg']
    dias = ['21-06-2023']
    espaciamientos = ['0.50-m']
    alineaciones = ['000 deg']
    
    # Ruta al archivo acusim.bat
    acusim_bat = r"C:\Program Files\Altair\2024.1\SimLab\bin\win64\solvers\Acusolve\acusolve\win64\bin\acusim.bat"
    
    # Directorio base donde se encuentran las simulaciones
    base_dir = r"D:\Sebastian\Simulations\DOEExpotecnologica"
    
    # Directorio donde se almacenarán los resultados
    results_dir = r"D:\Sebastian\Simulations\DOEExpotecnologica\Results"
    
    # Verificar que el directorio de resultados existe; si no, crearlo
    os.makedirs(results_dir, exist_ok=True)
    
    # Iterar sobre cada combinación de día, espaciamiento y alineación
    for dia in dias:
        for espaciamiento in espaciamientos:
            for alineacion in alineaciones:
                # Construir la ruta al directorio de la simulación actual
                dir_path = os.path.join(
                    base_dir,
                    dia,
                    f"{espaciamiento}-{alineacion}-{dia}",
                    f"{espaciamiento}-{alineacion}-{dia}_slb",
                    r"Solutions\SolarRadiationCFD\Results\Result files"
                )
    
                if not os.path.isdir(dir_path):
                    print(f"No se encontró el directorio: {dir_path}")
                    continue
    
                # Cambiar al directorio de trabajo actual
                os.chdir(dir_path)
                print(f"Procesando directorio: {dir_path}")
    
                try:
                    # Ejecutar acusim.bat y acuTrans para obtener la Temperatura Integrada
                    cmd1 = f'call "{acusim_bat}" && acuTrans -pb SolarRadiationCFD -osi -osis "WallFBRsIn" -to table -osiv time_step,time,area,temperature'
    
                    # Ejecutar el primer comando
                    subprocess.run(cmd1, shell=True, check=True)
    
                    # Nombre original del archivo generado por cmd1
                    original_filename_1 = os.path.join(dir_path, 'SolarRadiationCFD_srf6.osi')
    
                    # Nuevo nombre para el archivo, incluyendo parámetros en el nombre
                    filename_Temperature = f"Temperature-{espaciamiento}-{alineacion}-{dia}.osi"
                    file_Temperature = os.path.join(results_dir, filename_Temperature)
    
                    # Renombrar y mover el archivo al directorio de resultados
                    if os.path.exists(original_filename_1):
                        shutil.move(original_filename_1, file_Temperature)
                        print(f"Archivo movido: {file_Temperature}")
                    else:
                        print(f"No se encontró el archivo: {original_filename_1}")
    
                    # Ejecutar acusim.bat y acuTrans para obtener el Flujo de Calor Integrado
                    cmd2 = f'call "{acusim_bat}" && acuTrans -pb SolarRadiationCFD -oqi -oqis "SRSurfaceFBRsIn" -to table'
    
                    # Ejecutar el segundo comando
                    subprocess.run(cmd2, shell=True, check=True)
    
                    # Nombre original del archivo generado por cmd2
                    original_filename_2 = os.path.join(dir_path, 'SolarRadiationCFD_srf3.oqi')
    
                    # Nuevo nombre para el archivo, incluyendo parámetros en el nombre
                    filename_Irradiance = f"Irradiance-{espaciamiento}-{alineacion}-{dia}.oqi"
                    file_Irradiance = os.path.join(results_dir, filename_Irradiance)
    
                    # Renombrar y mover el archivo al directorio de resultados
                    if os.path.exists(original_filename_2):
                        shutil.move(original_filename_2, file_Irradiance)
                        print(f"Archivo movido: {file_Irradiance}")
                    else:
                        print(f"No se encontró el archivo: {original_filename_2}")
    
                    print(f"Comandos ejecutados correctamente en {dir_path}\n")
    
                except subprocess.CalledProcessError as e:
                    print(f"Error al ejecutar comandos en {dir_path}: {e}")
    

    I hope this contribution proves useful for others facing a similar situation.