|
[Sponsors] |
Save the InitialResidual as a variable in personalized solver |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 1, 2023, 12:35 |
Save the InitialResidual as a variable in personalized solver
|
#1 |
New Member
Martin Marone
Join Date: Oct 2023
Posts: 3
Rep Power: 3 |
Hi everyone!
I am wondering how can I save the "Initial residual" reported by the different OpenFOAM numerical solvers as a variable that then I can use for example to define the convergence criteria for a system of partial differential Eq. In particular I am now interested in the momentum equation (UEqn.H), which I am taking from OpenFOAM's native "buoyantBoussinesqSimpleFoam" implementation, which I present bellow: Code:
MRF.correctBoundaryVelocity(U); tmp<fvVectorMatrix> tUEqn ( fvm::div(phi, U) + MRF.DDt(U) + turbulence->divDevReff(U) == fvOptions(U) ); fvVectorMatrix& UEqn = tUEqn.ref(); UEqn.relax(); fvOptions.constrain(UEqn); if (simple.momentumPredictor()) { solve ( UEqn == fvc::reconstruct ( ( - ghf*fvc::snGrad(rhok) - fvc::snGrad(p_rgh) )*mesh.magSf() ) ); fvOptions.correct(U); } Code:
scalar initResUx = yourSolutionHere; scalar initResUy = yourSolutionHere; scalar initResUz = yourSolutionHere; scalar initResUEqn = initResUx+initResUy+initResUz; |
|
Tags |
residual, ueqn |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error: WorkBench Error: Could not handle event: SolutionStatusUpdate | Kieyo | Fluent Multiphase | 0 | November 10, 2022 00:58 |
two different gas! Fluid pair model! | saha2122 | CFX | 7 | February 9, 2022 08:15 |
[ANSYS Meshing] Help with element size | sandri_92 | ANSYS Meshing & Geometry | 14 | November 14, 2018 08:54 |
Solver with variable viscosity | wildfire230 | OpenFOAM Running, Solving & CFD | 3 | May 22, 2018 09:09 |
Env variable not set | gruber2 | OpenFOAM Installation | 5 | December 30, 2005 05:27 |