Strange behaviour in the NeuralPDE framework when implementing PINN

When I try to train the Neural Network with the LBFGS or BFGS Optimization algorithm, I see that the training speed keeps fluctuating with time. Suddenly the iterations seems to have frozen and no updates are visible and again few iterations are faster. Why is this the case with LBFGS or BFGS optimizers. When training with ADAM, the iterations are consistent but for some reason the data loss doesnt go down after a fixed number of iterations. Then, increasing the network architecture is of no use and hinders perfromance…Can someone help me with the issue and advice me on how to solve a system of PDE’s like the RANS equations with energy equation and the BC’s in addition to experimental data using NeuralPDE effiiciently…?

That’s due to the linesearch rejecting some steps.

Add the energy equation as a constraint via a BC.

But physically, how can I add the equation as a boundary condition and what is the basis of doing so? WHy would I have to shift the energy equation to the boundary condition list? Would this improve the performance of the training @ChrisRackauckas ? Also, if I have to add them, how do I exactly do that? Just cut paste the energy equation defined as eqs into the bcs array? Your help would be really appreciated and acknowledged duely in this regard…

BCs are generally just algebraic equations.

So instead of this…

# Constructing the PDE System symbolically to solve the Physics Informed Neural Network (PINN's) in a SciML ecosystem
# Define the parameters and the variables in the PDE
@parameters X, Y
@variables U(..), V(..), u′u′_mean(..), u′v′_mean(..), v′v′_mean(..), Θ(..), u′θ′_mean(..), v′θ′_mean(..), P(..)

# Define the derivatives to be used in defining the PDE system
DXX = Differential(X)^2
DX = Differential(X)
DYY = Differential(Y)^2
DY = Differential(Y)

# Define the Reynolds and Prandtl number here
const Re::T = 1880
const Pr::T = 0.72
const k::T  = 0.03 # Thermal condutivity of air at a particular temperature
const Dₕ::T = 0.025 # Hydraulic diameter of the square channel
const Q̇::T = 13 # This is the power input to the flat plate
const ṁ::T = 25 # LPM units
const convFactor::T = 0.00002042 # Conversion factor for converting LPM to (kg/s)
const Cₚ::T = 1006 # Specfic heat at contant pressure
const A::T = 0.1*0.02 # This is the area of the flat plate used for heating
const ΔT::T = Q̇/(ṁ*convFactor*Cₚ)
#q̅ = -(((Q̇/A)*Dₕ)/(k*ΔT))

eqs = [DX(U(X,Y)) + DY(V(X,Y)) ~ 0,
       U(X,Y)*DX(U(X,Y)) + V(X,Y)*DY(U(X,Y)) + DX(u′u′_mean(X,Y)) + DY(u′v′_mean(X,Y)) + DX(P(X,Y)) - (1/Re)*(DXX(U(X,Y)) + DYY(U(X,Y))) ~ 0,
       U(X,Y)*DX(V(X,Y)) + V(X,Y)*DY(V(X,Y)) + DX(u′v′_mean(X,Y)) + DY(v′v′_mean(X,Y)) + DY(P(X,Y)) - (1/Re)*(DXX(V(X,Y)) + DYY(V(X,Y))) ~ 0,
       U(X,Y)*DX(Θ(X,Y)) + V(X,Y)*DY(Θ(X,Y)) + DX(u′θ′_mean(X,Y)) + DY(v′θ′_mean(X,Y)) - (1/(Re*Pr))*(DXX(Θ(X,Y)) + DYY(Θ(X,Y))) ~ 0]

# Removed the boundary condition for the constant wall heat flux which is impractical for the experimental data  
bcs = [U(X,0) ~ 0, DX(U(X,0)) ~ 0, V(X,0) ~ 0, DY(V(X,0)) ~ 0, u′u′_mean(X,0) ~ 0, u′v′_mean(X,0) ~ 0, v′v′_mean(X,0) ~ 0, u′θ′_mean(X,0) ~ 0, v′θ′_mean(X,0) ~ 0, DYY(Θ(X,0)) ~ 0]
#bcs=[0~0]
# Define the space domain for symbolic processing
domains = [X ∈ Interval(0,3.25),
           Y ∈ Interval(0,0.5)]

Just remove the energy from the eqs list and put it in bc list?

@ChrisRackauckas Can you comment on the above question please?

For a PINN it actually doesn’t matter too much in which spot it goes, unless you put it into constrained mode.