You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GiudGiud opened this issue
Nov 13, 2024
· 2 comments
Labels
P: normalA defect affecting operation with a low possibility of significantly affects.T: defectAn anomaly, which is anything that deviates from expectations.
Perfect Jacobian achieved using AD for the fully coupled approach become incorrect as soon as we switch to multi-system.
At this point, I am about 70% sure because of AD derivatives being propagated from one system to the next
Steps to Reproduce
Run this with Navier Stokes with my multi-sys branch
mu=1
rho=1
diff=1e-3
advected_interp_method='average'
velocity_interp_method='rc'
[GlobalParams]
rhie_chow_user_object = 'rc'
advected_interp_method='average'
velocity_interp_method='rc'
[]
[UserObjects]
[rc]
type = INSFVRhieChowInterpolator
u = u
v = v
pressure = pressure
[]
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = -1
ymax = 1
nx = 10
ny = 5
[]
[]
[Variables]
[u]
type = INSFVVelocityVariable
initial_condition = 1
[]
[v]
type = INSFVVelocityVariable
initial_condition = 1
[]
[pressure]
type = INSFVPressureVariable
[]
[]
[Variables]
[scalar]
type = INSFVScalarFieldVariable
solver_sys = "scalar"
[]
[]
[AuxVariables]
[ax_out]
type = MooseVariableFVReal
[]
[ay_out]
type = MooseVariableFVReal
[]
[]
[AuxKernels]
[ax_out]
type = FunctorAux
functor = ax
variable = ax_out
execute_on = timestep_end
[]
[ay_out]
type = FunctorAux
functor = ay
variable = ay_out
execute_on = timestep_end
[]
[]
[FVKernels]
[mass]
type = INSFVMassAdvection
variable = pressure
rho = ${rho}
[]
[u_advection]
type = INSFVMomentumAdvection
variable = u
rho = ${rho}
momentum_component = 'x'
[]
[u_viscosity]
type = INSFVMomentumDiffusion
variable = u
mu = ${mu}
momentum_component = 'x'
[]
[u_pressure]
type = INSFVMomentumPressure
variable = u
momentum_component = 'x'
pressure = pressure
[]
[v_advection]
type = INSFVMomentumAdvection
variable = v
rho = ${rho}
momentum_component = 'y'
[]
[v_viscosity]
type = INSFVMomentumDiffusion
variable = v
mu = ${mu}
momentum_component = 'y'
[]
[v_pressure]
type = INSFVMomentumPressure
variable = v
momentum_component = 'y'
pressure = pressure
[]
[]
[FVBCs]
[inlet-u]
type = INSFVInletVelocityBC
boundary = 'left'
variable = u
function = '1'
[]
[inlet-v]
type = INSFVInletVelocityBC
boundary = 'left'
variable = v
function = 0
[]
[walls-u]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = u
function = 0
[]
[walls-v]
type = INSFVNoSlipWallBC
boundary = 'top bottom'
variable = v
function = 0
[]
[outlet_p]
type = INSFVOutletPressureBC
boundary = 'right'
variable = pressure
function = 0
[]
[]
[FVKernels]
[scalar_advection]
type = INSFVScalarFieldAdvection
variable = scalar
velocity_interp_method = ${velocity_interp_method}
advected_interp_method = ${advected_interp_method}
[]
[scalar_diffusion]
type = FVDiffusion
coeff = ${diff}
variable = scalar
[]
[scalar_src]
type = FVBodyForce
variable = scalar
value = 0.1
[]
[]
[FVBCs]
[inlet_scalar]
type = FVDirichletBC
boundary = 'left'
variable = scalar
value = 1
[]
[]
[Problem]
nl_sys_names = "nl0 scalar"
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options = '-snes_test_jacobian'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = 'none'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
Impact
Ruins convergence of Newton in multi-system problems due to incorrect Jacobian.
[Optional] Diagnostics
No response
The text was updated successfully, but these errors were encountered:
GiudGiud
added
T: defect
An anomaly, which is anything that deviates from expectations.
P: normal
A defect affecting operation with a low possibility of significantly affects.
labels
Nov 13, 2024
P: normalA defect affecting operation with a low possibility of significantly affects.T: defectAn anomaly, which is anything that deviates from expectations.
Bug Description
Perfect Jacobian achieved using AD for the fully coupled approach become incorrect as soon as we switch to multi-system.
At this point, I am about 70% sure because of AD derivatives being propagated from one system to the next
Steps to Reproduce
Run this with Navier Stokes with my multi-sys branch
Impact
Ruins convergence of Newton in multi-system problems due to incorrect Jacobian.
[Optional] Diagnostics
No response
The text was updated successfully, but these errors were encountered: