Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
GBenedett committed Jan 11, 2024
1 parent 593f989 commit cfef301
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
23 changes: 10 additions & 13 deletions ceasiompy/EdgeRun/edgerun.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
get_results_directory,
run_software,
)
#from ceasiompy.utils.commonnames import AINP_CFD_NAME, SU2_FORCES_BREAKDOWN_NAME

# from ceasiompy.utils.commonnames import AINP_CFD_NAME, SU2_FORCES_BREAKDOWN_NAME
from ceasiompy.utils.commonnames import AINP_CFD_NAME
from ceasiompy.utils.commonxpath import Edge_NB_CPU_XPATH
from ceasiompy.utils.moduleinterfaces import get_toolinput_file_path, get_tooloutput_file_path
Expand All @@ -56,8 +57,8 @@
def run_Edge_multi(wkdir, nb_proc=2):
"""Function to run a multiple Edge calculation.
Function 'run_Edge_multi' will run in the given working directory Edge calculations. The working
directory must have a folder structure created by 'SU2Config'/ 'EdgeConfig' module.
Function 'run_Edge_multi' will run in the given working directory Edge calculations.
The working directory must have a folder structure created by 'SU2Config'/ 'EdgeConfig' module.
Args:
wkdir (Path): Path to the working directory
Expand All @@ -72,7 +73,6 @@ def run_Edge_multi(wkdir, nb_proc=2):
raise OSError(f"No Case directory has been found in the working directory: {wkdir}")

for config_dir in sorted(case_dir_list):

config_cfd = [c for c in config_dir.iterdir() if c.name == AINP_CFD_NAME]

if not config_cfd:
Expand All @@ -86,15 +86,14 @@ def run_Edge_multi(wkdir, nb_proc=2):
arguments=[config_cfd[0], str(nb_proc)],
wkdir=config_dir,
with_mpi=False,
# nb_proc
# nb_proc
)


#forces_breakdown_file = Path(config_dir, SU2_FORCES_BREAKDOWN_NAME)
#if not forces_breakdown_file.exists():
# forces_breakdown_file = Path(config_dir, SU2_FORCES_BREAKDOWN_NAME)
# if not forces_breakdown_file.exists():
# raise ValueError(
# "The SU2_CFD calculation has not ended correctly,"
# f"{SU2_FORCES_BREAKDOWN_NAME} is missing!"
# "The SU2_CFD calculation has not ended correctly,"
# f"{SU2_FORCES_BREAKDOWN_NAME} is missing!"
# )


Expand All @@ -104,7 +103,6 @@ def run_Edge_multi(wkdir, nb_proc=2):


def main(cpacs_path, cpacs_out_path):

log.info("----- Start of " + MODULE_NAME + " -----")

tixi = open_tixi(cpacs_path)
Expand All @@ -117,13 +115,12 @@ def main(cpacs_path, cpacs_out_path):

generate_edge_cfd_ainp(cpacs_path, cpacs_tmp_cfg, results_dir)
run_Edge_multi(results_dir, nb_proc)
#get_su2_results(cpacs_tmp_cfg, cpacs_out_path, results_dir)
# get_su2_results(cpacs_tmp_cfg, cpacs_out_path, results_dir)

log.info("----- End of " + MODULE_NAME + " -----")


if __name__ == "__main__":

cpacs_path = get_toolinput_file_path(MODULE_NAME)
cpacs_out_path = get_tooloutput_file_path(MODULE_NAME)

Expand Down
5 changes: 3 additions & 2 deletions ceasiompy/EdgeRun/func/edgeconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
# write_actuator_disk_data,
# write_header,
# )

from ceasiompy.EdgeRun.func.edgeutils import get_edge_ainp_template
from ceasiompy.utils.ceasiomlogger import get_logger
from ceasiompy.utils.commonnames import (
Expand Down Expand Up @@ -197,8 +198,8 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir):
speedofsound = Atm.speed_of_sound[0]
airspeed = mach * speedofsound

aoa_rad = math.radians(aoa)
aos_rad = math.radians(aos)
# aoa_rad = math.radians(aoa)
# aos_rad = math.radians(aos)

UFREE = airspeed * math.cos(aos) * math.cos(aoa)
WFREE = airspeed * math.cos(aos) * math.sin(aoa)
Expand Down
6 changes: 3 additions & 3 deletions ceasiompy/EdgeRun/tests/test_edgerun.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
from pathlib import Path

# Add the ceasiompy module to the PYTHONPATH
ceasiompy_path = Path("/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/ceasiompy")
sys.path.append(str(ceasiompy_path))
# ceasiompy_path = Path("/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/ceasiompy")
# sys.path.append(str(ceasiompy_path))

# Now you can import and use the ceasiompy module
# import ceasiompy
Expand Down Expand Up @@ -65,4 +65,4 @@ def test_generate_edge_cfd_ainp(self):
print("Test configfile.py")
print("To run test use the following command:")
print(">> pytest -v")
"""
"""

0 comments on commit cfef301

Please sign in to comment.