|
[Sponsors] |
June 28, 2011, 16:51 |
Initial residuals do not decrease...
|
#1 |
New Member
Join Date: Jun 2011
Posts: 3
Rep Power: 15 |
Hi everyone!
I'm rookie on the forum and I'd like to start by greeting all the members for the very interesting topics that are being discussed here. I recently tried to simulate the unsteady around a basic 2-D cylinder using the solvers available in OpenFoam, in particular pimpleDyMFoam. Basically the code I use is the looks like: Code:
// Do any mesh changes mesh.update(); // Make the fluxes relative to the mesh motion fvc::makeRelative(phi, U); if (mesh.changing() ) { #include "meshCourantNo.H" } for (int ocorr=0; ocorr<nOuterCorr; ocorr++) { // Pressure-velocity SIMPLE corrector { #include "UEqn.H" #include "pEqn.H" } turbulence->correct(); } Code:
// Solve the Momentum equation fvVectorMatrix UEqn ( fvm::ddt(U) +fvm::div(phi, U) + turbulence->divDevReff(U) ); UEqn.relax(); eqnResidual = solve ( UEqn == -fvc::grad(p) ).initialResidual(); maxResidual = max(eqnResidual, maxResidual); Code:
p.boundaryField().updateCoeffs(); volScalarField AU = UEqn.A(); U = UEqn.H()/AU; //UEqn.clear(); phi = fvc::interpolate(U) & mesh.Sf(); adjustPhi(phi, U, p); // Non-orthogonal pressure corrector loop for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pEqn ( fvm::laplacian(1.0/AU, p) == fvc::div(phi) ); pEqn.setReference(pRefCell, pRefValue); if (nonOrth == 0) { eqnResidual = pEqn.solve().initialResidual(); maxResidual = max(eqnResidual, maxResidual); } else if( ocorr == nOuterCorr-1 && nonOrth == nNonOrthCorr) { pEqn.solve(mesh.solver(p.name() + "Final")); } else { pEqn.solve(); } if (nonOrth == nNonOrthCorr) { phi -= pEqn.flux(); } } # include "continuityErrs.H" // Explicitly relax pressure for momentum corrector p.relax(); // Momentum corrector U -= fvc::grad(p)/AU; U.correctBoundaryConditions();
Code:
Mesh Courant Number mean: 1.03403 max: 1645.15 smoothSolver: Solving for Ux, Initial residual = 0.000663609, Final residual = 2.88668e-06, No Iterations 8 smoothSolver: Solving for Uz, Initial residual = 0.00548648, Final residual = 2.28391e-05, No Iterations 8 DICPCG: Solving for p, Initial residual = 0.828448, Final residual = 9.83331e-07, No Iterations 506 DICPCG: Solving for p, Initial residual = 0.211827, Final residual = 9.78121e-07, No Iterations 478 DICPCG: Solving for p, Initial residual = 0.0673258, Final residual = 9.56774e-07, No Iterations 468 time step continuity errors : sum local = 5.6259e-12, global = 4.41739e-20, cumulative = 1.4129e-19 smoothSolver: Solving for omega, Initial residual = 7.3622e-06, Final residual = 7.40485e-09, No Iterations 4 smoothSolver: Solving for k, Initial residual = 0.0114753, Final residual = 3.82431e-06, No Iterations 3 smoothSolver: Solving for Ux, Initial residual = 0.000132713, Final residual = 1.01532e-06, No Iterations 8 smoothSolver: Solving for Uz, Initial residual = 0.000974607, Final residual = 6.52005e-06, No Iterations 8 DICPCG: Solving for p, Initial residual = 0.804658, Final residual = 9.75985e-07, No Iterations 513 DICPCG: Solving for p, Initial residual = 0.241636, Final residual = 9.50152e-07, No Iterations 481 DICPCG: Solving for p, Initial residual = 0.0714927, Final residual = 9.76869e-07, No Iterations 458 time step continuity errors : sum local = 5.33943e-12, global = 1.72288e-20, cumulative = 1.58519e-19 smoothSolver: Solving for omega, Initial residual = 1.39838e-06, Final residual = 8.80479e-09, No Iterations 3 smoothSolver: Solving for k, Initial residual = 0.00313893, Final residual = 1.69267e-06, No Iterations 3 I'm a beginner in CFD so do not hesitate to correct or highlight any misinterpretations or vocabulary misuses. Great thanks! Igor |
|
July 11, 2011, 15:05 |
|
#2 |
New Member
Join Date: Feb 2011
Posts: 20
Rep Power: 15 |
I'm also interested by this post, nobody has a clue?
|
|
March 6, 2013, 14:07 |
|
#3 |
New Member
Join Date: Apr 2012
Posts: 21
Rep Power: 14 |
I am trying to solve equation
fvScalarMatrix CEqn ( fvm::ddt(C) + fvm::div(phi, C) ); CeqnResidual = CEqn.solve().initialResidual(); In case where phi is zero (i.e. no flow), my initial residuals are always high (~ 0.3). When I am forcing the solver to exit without satisfying the convergence criterion (by setting a maximum for the iterations), I see that phi is zero everywhere and C is constant, as I expect. But, I don't know why CeqnResidual is high! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Extrusion with OpenFoam problem No. Iterations 0 | Lord Kelvin | OpenFOAM Running, Solving & CFD | 8 | March 28, 2016 12:08 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
How to write k and epsilon before the abnormal end | xiuying | OpenFOAM Running, Solving & CFD | 8 | August 27, 2013 16:33 |
Orifice Plate with a fully developed flow - Problems with convergence | jonmec | OpenFOAM Running, Solving & CFD | 3 | July 28, 2011 06:24 |
Differences between serial and parallel runs | carsten | OpenFOAM Bugs | 11 | September 12, 2008 12:16 |