Hello,

Sorry for the long post, but I need help troubleshooting a CFD simulation.

I’m trying to simulate airflow in a classroom with students and tables. The classroom has:

  • 3 inlets (vents on the roof),
  • 3 outlets (also vents),
  • 1 door, and
  • 3 windows (considered as "walls" since they are closed).

The room dimensions are 3 x 5 x 8 meters. To avoid errors with ideasFoam, I modeled the humans as cylinders with a mouth. The cylinder bases are linked to the floor, and the tables are attached to the walls. When I created the mesh, the cylinder bases became part of the floor, and one face of each table was linked to the wall. This setup allowed ideasFoam to function without errors.

I refined the mesh multiple times, and checkMesh reports no issues.

Next, I used createBaffles to add face zones to the boundary file, as everything inside the box was initially added to the faceZones file, not boundary. Once the boundaries were correctly updated, I defined:

  • 3 tables and 4 humans (excluding the mouth) as walls.
  • Inlets, outlets, and mouths as patches.

(This is a simplified test setup. Once it works, I plan to include all students and tables.)

After preparing everything, I ran simpleFoam with the setup. To ensure stability, I:

  • Reduced the time step (deltaT),
  • Adjusted relaxation factors, and
  • Tightened solver tolerances (resTol).

Unfortunately, the simulation crashed immediately.

When I changed the solver for p (pressure) to PCG, the simulation ran. It converged smoothly with a small time step (deltaT = 0.001) until 1.5 seconds. However, after this point, the bounding k starts to increase steadily, reaching unrealistic values (e.g., max: 9.38163e+07).

Do you have any insights into what I might be doing wrong?

Here are the files I used:

  • boundary
  • U
  • p
  • k
  • epsilon
  • nut
  • fvSchemes
  • fvSolution

Thank you in advance for your help!

Here's an example of the spike :

Time = 3s

smoothSolver: Solving for Ux, Initial residual = 0.00371234, Final residual = 6.68207e-06, No Iterations 2

smoothSolver: Solving for Uy, Initial residual = 0.00396574, Final residual = 1.20463e-05, No Iterations 2

smoothSolver: Solving for Uz, Initial residual = 0.00397317, Final residual = 1.27557e-05, No Iterations 2

DICPCG: Solving for p, Initial residual = 0.000101223, Final residual = 9.75821e-06, No Iterations 35

DICPCG: Solving for p, Initial residual = 3.88401e-05, Final residual = 9.83166e-06, No Iterations 21

DICPCG: Solving for p, Initial residual = 1.7923e-05, Final residual = 9.83142e-06, No Iterations 17

time step continuity errors : sum local = 3.33501e-05, global = 2.51784e-05

DICPCG: Solving for p, Initial residual = 8.00657e-05, Final residual = 9.98959e-06, No Iterations 35

DICPCG: Solving for p, Initial residual = 3.17717e-05, Final residual = 9.49924e-06, No Iterations 21

DICPCG: Solving for p, Initial residual = 1.54928e-05, Final residual = 9.994e-06, No Iterations 1

time step continuity errors : sum local = 3.37548e-05, global = 2.51818e-05, cumulative = 0.00310968

smoothSolver: Solving for epsilon, Initial residual = 0.00443172, Final residual = 8.7404e-07, No Iterations 2

smoothSolver: Solving for k, Initial residual = 0.00427727, Final residual = 2.12083e-06, No Iterations 2

bounding k, min: 1.82005e-16 max: 9.38163e+07 average: 62990.6

ExecutionTime = 8353.48 s ClockTime = 8355 s

More Joseph Gerges's questions See All
Similar questions and discussions