Skip to content
Snippets Groups Projects
Commit 2f90efb0 authored by Paul Dechamps's avatar Paul Dechamps :speech_balloon:
Browse files

(fix) Small fix in blSolverInterface error raise

parent e060eddc
No related branches found
No related tags found
No related merge requests found
Pipeline #52502 failed
...@@ -798,7 +798,7 @@ class SolversInterface: ...@@ -798,7 +798,7 @@ class SolversInterface:
else: else:
raise RuntimeError('Expected "sections" in cfg') raise RuntimeError('Expected "sections" in cfg')
if len(cfg['sections']) != self.getnBodies(): if len(cfg['sections']) != self.getnBodies():
raise RuntimeError(f'Expected the length of "sections" to be {self.getnBodies()}, got {len(self.cfg["sections"])}') raise RuntimeError(f'Expected the length of "sections" to be {self.getnBodies()}, got {len(cfg["sections"])}')
return cfg return cfg
def _initDataStructures(self)->tuple[list, list]: def _initDataStructures(self)->tuple[list, list]:
...@@ -907,6 +907,7 @@ class SolversInterface: ...@@ -907,6 +907,7 @@ class SolversInterface:
allregs.append(vreg.type) allregs.append(vreg.type)
# Compute average and max AR of viscous cells # Compute average and max AR of viscous cells
avgAR = 0 avgAR = 0
nNodes = 0
if self.getnDim() == 3: if self.getnDim() == 3:
point_cpt = 0 point_cpt = 0
for isec in range(1,len(self.vBnd[ibody])): for isec in range(1,len(self.vBnd[ibody])):
...@@ -920,8 +921,13 @@ class SolversInterface: ...@@ -920,8 +921,13 @@ class SolversInterface:
# AR = b^2 / S # AR = b^2 / S
avgAR += dy**2 / (dx * dy) avgAR += dy**2 / (dx * dy)
point_cpt += 1 point_cpt += 1
nNodes += 1
avgAR /= point_cpt avgAR /= point_cpt
print(f' -{ibody}: {bodyName}, {len(self.vBnd[ibody])} section(s) with sides {allregs}, avg AR {avgAR:.2f}') elif self.getnDim() == 2:
for isec in range(len(self.vBnd[ibody])):
for ipoint in range(1,self.vBnd[ibody][isec][0].nodesCoord.shape[0]):
nNodes += 1
print(f' - {bodyName}: {len(self.vBnd[ibody])} section(s) with sides {allregs},\n\t{nNodes} surface nodes, avg AR {avgAR:.2f}')
print('') print('')
# Abstract methods for the interface # Abstract methods for the interface
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment