|
[Sponsors] |
Pressure difference as an input to simpleFoam |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#21 |
New Member
Zhen Liao
Join Date: Apr 2022
Posts: 16
Rep Power: 4 ![]() |
I used the fvSchemes that is the same as the tutorials case pitzDaily.
And I haven't simulated a more complex geometry yet. I'm now simulated a channel/fracture with some roughness, the newest result seems good to me. I'll try to model some fracture network later. Maybe you can try Tobermory's advice, i.e., adjust the tolerances, residualControls, and add a minIter? |
|
![]() |
![]() |
![]() |
![]() |
#22 | |
New Member
Zhen Liao
Join Date: Apr 2022
Posts: 16
Rep Power: 4 ![]() |
Quote:
These days I'm simulating water flow through a 2D rough fracture under a pressure gradient by simpleFoam. The setting for the fvSolution is as follows: Code:
solvers { p { solver GAMG; tolerance 1e-8; relTol 0; smoother GaussSeidel; minIter 1; } U { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-8; relTol 0; minIter 1; } } SIMPLE { nNonOrthogonalCorrectors 0; consistent yes; residualControl { p 1e-6; U 1e-6; } } relaxationFactors { fields { p 0.3; } equations { U 0.7; } } Code:
Time = 1000 smoothSolver: Solving for Ux, Initial residual = 0.000291035, Final residual = 9.60557e-09, No Iterations 10 smoothSolver: Solving for Uy, Initial residual = 0.000322102, Final residual = 7.96566e-09, No Iterations 10 GAMG: Solving for p, Initial residual = 0.00108005, Final residual = 8.47719e-09, No Iterations 56 time step continuity errors : sum local = 1.84608e-06, global = 7.58599e-09, cumulative = 4.27814e-05 ExecutionTime = 20234.6 s ClockTime = 20234 s Time = 2000 smoothSolver: Solving for Ux, Initial residual = 6.59773e-05, Final residual = 6.16032e-09, No Iterations 9 smoothSolver: Solving for Uy, Initial residual = 7.23523e-05, Final residual = 5.38957e-09, No Iterations 9 GAMG: Solving for p, Initial residual = 0.000254187, Final residual = 8.27609e-09, No Iterations 33 time step continuity errors : sum local = 1.97593e-06, global = -1.4394e-07, cumulative = 3.39222e-05 ExecutionTime = 36473.9 s ClockTime = 36474 s Time = 4000 smoothSolver: Solving for Ux, Initial residual = 0.0163418, Final residual = 6.67672e-09, No Iterations 17 smoothSolver: Solving for Uy, Initial residual = 0.017233, Final residual = 9.55891e-09, No Iterations 16 GAMG: Solving for p, Initial residual = 0.0172172, Final residual = 7.92271e-09, No Iterations 71 time step continuity errors : sum local = 3.07673e-05, global = -2.52422e-07, cumulative = -3.41828e-05 ExecutionTime = 60182 s ClockTime = 60182 s Time = 4702 smoothSolver: Solving for Ux, Initial residual = 0.992508, Final residual = 5.36214e+08, No Iterations 1000 smoothSolver: Solving for Uy, Initial residual = 0.996478, Final residual = 1.43153e+09, No Iterations 1000 GAMG: Solving for p, Initial residual = 1, Final residual = nan, No Iterations 1000 time step continuity errors : sum local = nan, global = nan, cumulative = nan ExecutionTime = 84536.6 s ClockTime = 84536 s Time = 4703 smoothSolver: Solving for Ux, Initial residual = nan, Final residual = nan, No Iterations 1000 smoothSolver: Solving for Uy, Initial residual = nan, Final residual = nan, No Iterations 1000 GAMG: Solving for p, Initial residual = nan, Final residual = nan, No Iterations 1000 time step continuity errors : sum local = nan, global = nan, cumulative = nan ExecutionTime = 84926.2 s ClockTime = 84926 s Can you give me some advice? Thank you very much! PS, though the fracture is pretty rough, the perssure gradient is relative small so that the Re is small and the flow should not get to turbulence. |
||
![]() |
![]() |
![]() |
![]() |
#23 | ||
Senior Member
Josh Williams
Join Date: Feb 2021
Location: Scotland
Posts: 113
Rep Power: 5 ![]() |
Quote:
Quote:
|
|||
![]() |
![]() |
![]() |
![]() |
#24 |
Senior Member
Join Date: Apr 2020
Location: UK
Posts: 711
Rep Power: 14 ![]() |
Just to add to Josh's excellent suggestions - the "nan" value for continuity residual is indeed a sign that your solution has blown up, and I would also suggest checking your mesh quality, boundary conditions and reducing the relaxation factors slightly.
Moving to a transient solver will probably be more stable, but will likely take longer to get to your steady solution, so worth trying a little longer to get the steady solver to work. Of course, a slow approach to a correct solution is better than a fast approach to a junk solution, so take my advice with a pinch of salt! Good luck. |
|
![]() |
![]() |
![]() |
![]() |
#25 | |
New Member
Zhen Liao
Join Date: Apr 2022
Posts: 16
Rep Power: 4 ![]() |
Quote:
I'll try the pimpleFoam later. And, I used the pressure-driven type according to me research objective, but maybe I'll consider the flow-driven ones later. Best! |
||
![]() |
![]() |
![]() |
![]() |
#26 | |
New Member
Zhen Liao
Join Date: Apr 2022
Posts: 16
Rep Power: 4 ![]() |
Quote:
Thank you for your advice. The boundary conditions should be no problem, as it got a good solution when the pressure gradient was small, and there is not any quite skewed mesh. And I tried reducing the relaxation factor to 0.5 & 0.3, both of them encountered the same problem. I think I'll try the pimpleFoam. Best, |
||
![]() |
![]() |
![]() |
![]() |
#27 | |
New Member
Zhen Liao
Join Date: Apr 2022
Posts: 16
Rep Power: 4 ![]() |
Quote:
These days I have tried the pimpleFoam based on the tutorials cases under the folder “/tutorials/incompressible/pimpleFoam/laminar”. I’m not sure how much time it’ll cost for my case, and I want the solver stops when the tolerance conditions are reached, so I add the residualControl as follows: Code:
PIMPLE { nCorrectors 2; nNonOrthogonalCorrectors 0; // //nOuterCorrectore 2; // //momentumPredictor off; // residualControl { p 1e-5; U 1e-5; } } Code:
Courant Number mean: 0.446783 max: 0.669648 deltaT = 1e-05 Time = 0.28842 smoothSolver: Solving for Ux, Initial residual = 6.23778e-09, Final residual = 4.37402e-10, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 9.99837e-07, Final residual = 4.41101e-09, No Iterations 2 GAMG: Solving for p, Initial residual = 1.55179e-10, Final residual = 8.75098e-12, No Iterations 1 time step continuity errors : sum local = 4.11461e-15, global = -2.19722e-15, cumulative = -1.15507e-08 GAMG: Solving for p, Initial residual = 1.54756e-10, Final residual = 8.86012e-12, No Iterations 1 time step continuity errors : sum local = 4.16583e-15, global = 1.83124e-15, cumulative = -1.15507e-08 ExecutionTime = 8412.92 s ClockTime = 8413 s PIMPLE solution converged in 0.28842 iterations End According to the log file, the solver didn’t stop until it got the endTime (1.5), even though the residuals were much smaller than I set in the residualControl (1e-5). Code:
Courant Number mean: 0.00192971 max: 0.0112378 Time = 1.5 smoothSolver: Solving for Ux, Initial residual = 7.56505e-07, Final residual = 2.84178e-11, No Iterations 1 smoothSolver: Solving for Uy, Initial residual = 7.75426e-07, Final residual = 2.8357e-11, No Iterations 1 GAMG: Solving for p, Initial residual = 6.71212e-08, Final residual = 1.28297e-08, No Iterations 1 time step continuity errors : sum local = 2.6825e-15, global = -5.42384e-16, cumulative = -1.31311e-10 GAMG: Solving for p, Initial residual = 3.53864e-08, Final residual = 1.1966e-08, No Iterations 1 time step continuity errors : sum local = 2.50191e-15, global = -3.23207e-18, cumulative = -1.31311e-10 ExecutionTime = 68419.4 s ClockTime = 71020 s End Finalising parallel run Code:
Courant Number mean: 1.2346e+102 max: 4.57473e+103 Time = 2.08499 smoothSolver: Solving for Ux, Initial residual = 0.730531, Final residual = 6.64896e-05, No Iterations 1000 smoothSolver: Solving for Uy, Initial residual = 0.738381, Final residual = 8.22353e-05, No Iterations 1000 GAMG: Solving for p, Initial residual = 0.989074, Final residual = 8.75592e-08, No Iterations 53 time step continuity errors : sum local = 1.26262e+95, global = 7.77481e+93, cumulative = 1.23051e+94 GAMG: Solving for p, Initial residual = 0.262815, Final residual = 9.00335e-08, No Iterations 45 time step continuity errors : sum local = 1.59688e+96, global = -5.21253e+94, cumulative = -3.98202e+94 ExecutionTime = 40376.8 s ClockTime = 40934 s Courant Number mean: 1.17916e+103 max: 5.25875e+104 Time = 2.085 smoothSolver: Solving for Ux, Initial residual = 0.71156, Final residual = 0.00334101, No Iterations 1000 smoothSolver: Solving for Uy, Initial residual = 0.720883, Final residual = 0.00112397, No Iterations 1000 srun: error: n0045: tasks 1-2: Floating point exception (core dumped) srun: error: n0045: tasks 0,3: Floating point exception (core dumped) I’m not sure if there are some settings are wrong. I attached the fvSolution, fvSchemes, controlDict files, maybe you can have a look. Thank you! |
||
![]() |
![]() |
![]() |
![]() |
#28 | |
New Member
Zhen Liao
Join Date: Apr 2022
Posts: 16
Rep Power: 4 ![]() |
Quote:
Hi everyone, these are my files: p: Code:
dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { "(INLET_1|INLET_2|INLET_3|INLET_4|INLET_5|INLET_6|INLET_7|INLET_8)" { type fixedValue; value uniform 0.01; } "(OUTLET_1|OUTLET_2|OUTLET_3|OUTLET_4|OUTLET_5|OUTLET_6|OUTLET_7|OUTLET_8)" { type fixedValue; value uniform 0; } WALL { type zeroGradient; } "(TOP|BOTTOM)" { type empty; } } Code:
dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { "(INLET_1|INLET_2|INLET_3|INLET_4|INLET_5|INLET_6|INLET_7|INLET_8)" { type pressureInletVelocity; phi phi; rho rho; value uniform (0 0 0); } "(OUTLET_1|OUTLET_2|OUTLET_3|OUTLET_4|OUTLET_5|OUTLET_6|OUTLET_7|OUTLET_8)" { type zeroGradient; } WALL { type noSlip; } "(TOP|BOTTOM)" { type empty; } } Code:
solvers { p { solver GAMG; tolerance 1e-7; relTol 0; smoother DICGaussSeidel; minIter 5; // } pFinal { $p; relTol 0; } U { solver smoothSolver; smoother symGaussSeidel; tolerance 1e-07; relTol 0; minIter 5; // } UFinal { $U; relTol 0; } } PIMPLE { nCorrectors 2; nNonOrthogonalCorrectors 0; // //nOuterCorrectore 2; // //momentumPredictor off; // residualControl { p 1e-5; U 1e-5; } } relaxationFactors { equations { ".*" 1; } } Code:
ddtSchemes { default Euler; } gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) Gauss linearUpwind grad(U); div((nuEff*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } Code:
application pimpleFoam; startFrom latestTime; startTime 0; stopAt endTime; endTime 3; deltaT 0.00001; writeControl adjustableRunTime; writeInterval 0.1; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable yes; adjustTimeStep no; // maxCo 3; functions { #includeFunc flowRatePatch(name=INLET_1) #includeFunc flowRatePatch(name=OUTLET_1) #includeFunc patchAverage(name=INLET_1,p) #includeFunc patchAverage(name=OUTLET_1,p) } Code:
Create time Create polyMesh for time = 0 Time = 0 Mesh stats points: 1461944 internal points: 0 faces: 2854285 internal faces: 1392335 cells: 707770 faces per cell: 6 boundary patches: 19 point zones: 0 face zones: 5 cell zones: 1 Overall number of cells of each type: hexahedra: 707770 prisms: 0 wedges: 0 pyramids: 0 tet wedges: 0 tetrahedra: 0 polyhedra: 0 Checking topology... Boundary definition OK. Cell to face addressing OK. Point usage OK. Upper triangular ordering OK. Face vertices OK. Number of regions: 1 (OK). Checking patch topology for multiply connected surfaces... Patch Faces Points Surface topology INLET_1 35 72 ok (non-closed singly connected) INLET_2 21 44 ok (non-closed singly connected) INLET_3 24 50 ok (non-closed singly connected) INLET_4 29 60 ok (non-closed singly connected) INLET_5 23 48 ok (non-closed singly connected) INLET_6 55 112 ok (non-closed singly connected) INLET_7 23 48 ok (non-closed singly connected) INLET_8 26 54 ok (non-closed singly connected) OUTLET_1 26 54 ok (non-closed singly connected) OUTLET_2 21 44 ok (non-closed singly connected) OUTLET_3 24 50 ok (non-closed singly connected) OUTLET_4 28 58 ok (non-closed singly connected) OUTLET_5 23 48 ok (non-closed singly connected) OUTLET_6 24 50 ok (non-closed singly connected) OUTLET_7 23 48 ok (non-closed singly connected) OUTLET_8 16 34 ok (non-closed singly connected) WALL 45989 92010 ok (non-closed singly connected) TOP 707770 730972 ok (non-closed singly connected) BOTTOM 707770 730972 ok (non-closed singly connected) Checking geometry... Overall domain bounding box (1.05767 -1.34728 -5e-06) (1.3494 -1.05778 0) Mesh has 2 geometric (non-empty/wedge) directions (1 1 0) Mesh has 2 solution (non-empty) directions (1 1 0) All edges aligned with or perpendicular to non-empty directions. Boundary openness (3.20635e-18 3.0694e-19 2.91732e-17) OK. Max cell openness = 2.54883e-16 OK. Max aspect ratio = 2.74176 OK. Minimum face area = 1.28173e-10. Maximum face area = 7.11969e-09. Face area magnitudes OK. Min volume = 5.61444e-15. Max volume = 3.55984e-14. Total volume = 1.87478e-08. Cell volumes OK. Mesh non-orthogonality Max: 59.1436 average: 20.7321 Non-orthogonality check OK. Face pyramids OK. Max skewness = 1.82248 OK. Coupled point location match (average 0) OK. Mesh OK. End |
||
![]() |
![]() |
![]() |
![]() |
#29 | |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 7 ![]() |
Dear Josh Williams
I am using simpleFoam, and my residuals goes down and then they start to increase again. What should I do for these types of residuals? My parameter of interest which is drag coefficient(Cd) has reached to a constant value without any change and it is stable. What should I do? can I rely on my Cd results? Thanks, Farzad Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#30 |
Senior Member
Josh Williams
Join Date: Feb 2021
Location: Scotland
Posts: 113
Rep Power: 5 ![]() |
Hi,
In my opinion, I would not rely simply on drag to verify if your simulation has converged (although I have heard this in the past). Drag is just estimated based on the surface pressure, if the pressure has converged to an incorrect solution (as shown by your residuals the velocity and pressure not converged very well), then the drag coefficient will be incorrect (although it may be 'converged' to a constant/steady value, it is still incorrect). Let me try to make sense of your residuals. although I am not sure what your application is, I guess it is an external flow around some object since you are interested in drag coefficient. The residuals go down as the flow is developing (it is steady so it is going well), then some unsteadiness begins to emerge (maybe vortex streets) and simpleFoam can no longer capture it (so your residuals increase). I think you should use pimpleFoam with the tolerance at around 1e-6 (maximum, I usually go for between 1e-8 to 1e-12). |
|
![]() |
![]() |
![]() |
![]() |
#31 |
New Member
Sina Sadrghi
Join Date: Mar 2024
Posts: 1
Rep Power: 0 ![]() |
Hi, Josh, I working on similar BC, a pipe with pressure driven of time-varing, can I have or can you share your p and U file for BC? I am stucked why my results are far from experimental.
cheers! |
|
![]() |
![]() |
![]() |
Tags |
boundary condition, internal flow, pipe flow, simplefoam convergence, simplefoam pressure bc |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Difference between p (pressure) and static pressure | PeterShi | OpenFOAM Post-Processing | 2 | March 19, 2019 16:23 |
pressure in incompressible solvers e.g. simpleFoam | chrizzl | OpenFOAM Running, Solving & CFD | 13 | March 28, 2017 05:49 |
Pressure difference at INLET and OUTLET. | lovegne | FLUENT | 2 | January 27, 2017 07:28 |
Neumann pressure BC and velocity field | Antech | Main CFD Forum | 0 | April 25, 2006 02:15 |
Hydrostatic pressure in 2-phase flow modeling (CFX4.2) | HB &DS | CFX | 0 | January 9, 2000 13:19 |