|
[Sponsors] |
How to implement a Jacobian-Free Newton-Krylov (JFNK) method |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 4, 2023, 12:05 |
How to implement a Jacobian-Free Newton-Krylov (JFNK) method
|
#1 |
New Member
Join Date: Apr 2023
Posts: 1
Rep Power: 0 |
Dear Foamers,
I am seeking your guidance and assistance in the implementation of JFNK (Jacobian-Free Newton-Krylov) methods based on the Gmres solver in foam-extend-4.1 for my current project. To provide some context, I am working on an open-source software based on Foam Extend. In order to enhance the accuracy and efficiency of simulations, the JFNK method has been identified as a potential solution to achieve these objectives. However, my limited familiarity with OpenFOAM, Foam Extend, and C++ is posing challenges in effectively implementing this method. Therefore, I kindly request your help on the following aspects: 1. How to modify the existing Foam Extend (GMRES) codebase to effectively incorporate the JFNK method. For this first point, I have made a copy of the GMRES solver files within a "libraries" folder in my application in order to make changes to the GMRES solver as it seems difficult to built a general Gmres JFNK solver. In the existing code (BlockGMRES and gmresSolver files), what I identified in the existing code (present in the BlockGMRES and gmresSolver files) is that the matrix.Amul command should be replaced by the finite difference of the numericals fluxes for the JFNK method as shown in the file attached. The numerical flux phi (u^k) refers to argument b of the GMRES method. My difficulty lies therefore in constructing the second numerical flux phi (u^k+epsilon*z) as it is expected to change in every iteration. I therefore tried to obtain in this solver the variables allowing the construction of the numerical flux such as: rho, rhoU, rhoE (to built it directly in the solver) by using the following command : Code:
const volScalarField& rho = this->Mesh_.lookupObject<volScalarField>("rho"); The first error is : Code:
error: 'class Foam::BlockGMRES<Foam::Tensor<double> >' has no member named 'Mesh_' 2. How to obtain from this solver, the values of the variables present on the mesh. (If I am on the right path to mplement the JFNK in the GMRES solver) I sincerely appreciate any support or guidance you can provide regarding these challenges. Thank you in advance for your assistance. Last edited by Murielle MG; July 17, 2023 at 06:19. Reason: Addition of pictures for the GMRES and GMRES with JFNK algorithms |
|
Tags |
foam extend 4.1, gmres, jacobian matrix, solver development |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
free package for the "direct method" | ztdep | Main CFD Forum | 0 | May 31, 2006 12:55 |
about the numerical method for the free surface | ztdep | Main CFD Forum | 5 | May 1, 2006 17:09 |
free surface potential method | paolo | Main CFD Forum | 0 | September 19, 2004 14:29 |
seeking free 3D panel method code | frederic felten | Main CFD Forum | 2 | January 24, 2001 05:42 |
Numerical method for free surface flow? | Oleg Melnik | Main CFD Forum | 4 | January 22, 1999 06:28 |