Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jacobian not recorded correctly in AD preaccumulation region #2368

Closed
3 tasks done
joshkellyjak opened this issue Oct 18, 2024 · 1 comment
Closed
3 tasks done

Jacobian not recorded correctly in AD preaccumulation region #2368

joshkellyjak opened this issue Oct 18, 2024 · 1 comment

Comments

@joshkellyjak
Copy link
Contributor

Describe the bug

You will have to bear with me, I might get some of this wrong, I am not entirely sure what is going on here so I will try and include as much information as possible. Using the tape tagging method developed by @oleburghardt in #2343 and presented at the most recent SU2 Conference, a run of the full tape reveals that a variable used in a preaccumulation output is not properly recorded. The variable is the val in the function PassiveAssign in CSysMatrix.hpp line 215.

FORCEINLINE static ScalarType PassiveAssign(const SrcType& val) { return SU2_TYPE::GetValue(val); }

Following the call stack of the error reveals that the problem variables in val are the jacobian components calculated in the Roe and JST scheme (these are the two options I have tested). It is possible to resolve this error by simply moving the stopping of the preaccumulation region from before the call to updateLinearSystem in the ComputeFlux method of both these schemes, to after, as show below.

`/--- Update the vector and system matrix. ---/

updateLinearSystem(iEdge, iPoint, jPoint, implicit, updateType,
                   updateMask, flux, jac_i, jac_j, vector, matrix);

/*--- Stop preaccumulation. ---*/

stopPreacc(flux);`

However, whilst this resolve the error in this location, the next error appears in the Giles boundary condition. Here the two jacobian components within the residual object are not recorded correctly in the preaccumulation output region also. This in CEulerSolver.cpp:6556.

`/--- Compute the residual using an upwind scheme ---/
auto residual = conv_numerics->ComputeResidual(config);

  /*--- Update residual value ---*/
  LinSysRes.AddBlock(iPoint, residual);`

I have tried simpy adding these components as preacc outputs however they are SIMD arrays and the datatype cannot be converted using the existing implementation.

I am not sure what is going on here, or the next steps to resolve this problem. Any further assistance would be greatly appreciated, thank you :)

Bug report checklist
Please make sure that you have followed the checklist below, many common problems can be solved by:

Desktop (please complete the following information):

  • OS: [MacOS Sonoma 14.6.1]
  • C++ compiler and version: [clang 14.0.3 "Apple clang version 14.0.3 (clang-1403.0.22.14.1)]
  • MPI implementation and version: [OpenMPI 5.0.3]
  • SU2 Version: [v8.0.1]
@pcarruscag
Copy link
Member

The Jacobian matrix is passive, you'd need a TB of ram to run an inviscid NACA0012 otherwise.

@pcarruscag pcarruscag removed the bug label Oct 18, 2024
@su2code su2code locked and limited conversation to collaborators Oct 18, 2024
@pcarruscag pcarruscag converted this issue into discussion #2370 Oct 18, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants