SaveScalars solver in parallel

Numerical methods and mathematical models of Elmer
Post Reply
RubenNavas
Posts: 6
Joined: 17 Apr 2024, 13:14
Antispam: Yes

SaveScalars solver in parallel

Post by RubenNavas »

Hello,
I'm performing a simulation of the flow passed an airfoil by using ElmerGUI. One of the objectives is to calculate the lift and drag forces. To do so, I'm using the "Calculate Loads" in the Navier-Stokes solver and summing them over the airfoil using the SaveScalars solver. The .sif code parts are hereafter detailed:

The Navier-Stokes part:

Code: Select all

Solver 2
  Equation = Navier-Stokes
  Calculate Loads = True
  Procedure = "FlowSolve" "FlowSolver"
  Variable = Flow Solution[Velocity:2 Pressure:1]
  Exec Solver = Always
  Stabilize = True
  Optimize Bandwidth = True
  Steady State Convergence Tolerance = 1.0e-5
  Nonlinear System Convergence Tolerance = 1.0e-4
  Nonlinear System Max Iterations = 10
  Nonlinear System Newton After Iterations = 3
  Nonlinear System Newton After Tolerance = 1.0e-3
  Nonlinear System Relaxation Factor = 0.5
  Linear System Solver = Iterative
  Linear System Iterative Method = BiCGStab
  Linear System Max Iterations = 1000000
  Linear System Convergence Tolerance = 1.0e-6
  BiCGstabl polynomial degree = 2
  Linear System Preconditioning = ILU0
  Linear System ILUT Tolerance = 1.0e-3
  Linear System Abort Not Converged = False
  Linear System Residual Output = 10
  Linear System Precondition Recompute = 1
End
The SaveScalars solver:

Code: Select all

Solver 1
  Equation = SaveScalars
  Procedure = "SaveData" "SaveScalars"
  Variable 1 = Flow Solution Loads 1
  Parallel Reduce = True
  Operator 1 = boundary sum
  File Append = True
  Variable 2 = Flow Solution Loads 2
  Filename = fluidForces.dat
  Exec Solver = Always
End
The airfoil boundary condition:

Code: Select all

Boundary Condition 3
  Target Boundaries(1) = 8 
  Name = "Airfoil"
  Noslip wall BC = True
  Save Scalars = True
End
Nevertheless, when I execute the simulation in parallel I get a strange error, which does not appear if the simulation is ran in sequential. Additionally, I submit the entire .sif and the error output.

Thanks for the help.
Attachments
case.txt
(2.46 KiB) Downloaded 6 times
error.txt
(8.24 KiB) Downloaded 6 times
kevinarden
Posts: 2322
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: SaveScalars solver in parallel

Post by kevinarden »

ElmerGrid writes the mesh to a subdirectory
The case file specifies looking for the mesh in the current directory.
I think it can't find the partitioned mesh
RubenNavas
Posts: 6
Joined: 17 Apr 2024, 13:14
Antispam: Yes

Re: SaveScalars solver in parallel

Post by RubenNavas »

Hello,

Firstly, thank you for your response. I hadn't considered that cause. However, I am unsure how to specify to ElmerFEM the directory for the parallel mesh. Could you please provide instructions on how to do so? Additionally, I have attached the case.sif file and a screenshot of the case folder.

Thank you.
Attachments
ElmerCase.PNG
ElmerCase.PNG (77.54 KiB) Viewed 249 times
case.sif
(2.68 KiB) Downloaded 5 times
kevinarden
Posts: 2322
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: SaveScalars solver in parallel

Post by kevinarden »

The mesh location is specified in the header on the line
Mesh DB "." "."
This is at the top of the form in ElmerGUI setup.

. . meaning current directory
your mesh is in the current directory

Your error.txt file reports
The mesh will be partitioned with Metis to 2 partitions.
meaning that ElmerGrid will create the partions in a direct called
partitioning.2
the last number is the number of partitions

ElmerGRid reports
Created subdirectory: partitioning.2
Saving mesh in parallel ElmerSolver format to directory E:/Eurepabaqus/Proves/Ruben/NACA/partitioning.2.

ElmerSolver reports
WARNING:: LoadMesh: Requested mesh > ./. < in partition 2 does not exist!

Your directory shows a partitioning.24 directory but no partitioning.2 directory?
RubenNavas
Posts: 6
Joined: 17 Apr 2024, 13:14
Antispam: Yes

Re: SaveScalars solver in parallel

Post by RubenNavas »

Hello, thank you for your response. The 'partitioning.2' and 'partitioning.24' folders represent two different trials. If I am conducting the simulation using 24 cores, and as a result, the 'partitioning.24' folder is created, what do I need to specify in the .sif file? Thanks.
kevinarden
Posts: 2322
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: SaveScalars solver in parallel

Post by kevinarden »

If your mesh is in the current directory and your number of cores specified for the solver is the same as the number of partitions then
Mesh DB "." "."

should be ok since your mesh is in the current directory.
RubenNavas
Posts: 6
Joined: 17 Apr 2024, 13:14
Antispam: Yes

Re: SaveScalars solver in parallel

Post by RubenNavas »

Thanks, I finally managed to find the solution. I changed the solver execution to "After Timestep" and it worked.
Post Reply