-
Notifications
You must be signed in to change notification settings - Fork 848
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
Physics-informed neural networks for data-driven fluid model #2444
base: develop
Are you sure you want to change the base?
Conversation
…f flame front initialization
…cs-informed neural networks
SU2_MPI::Error("Outlet pressure ramp only implemented for NRBC", CURRENT_FUNCTION); | ||
config->SetRiemann_Var1(outPres, Marker_Tag); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@EvertBunschoten I made some modifcations to this part of the code in #2419 , I'll try close it today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update: finished now.
Common/include/CConfig.hpp
Outdated
/*! | ||
* \brief Get initial density value for Newton solver in data-driven fluid model. | ||
* \return Initial density value. | ||
*/ | ||
su2double GetInitialDensity_DataDriven(void) const { return DataDriven_rho_init; } | ||
|
||
/*! | ||
* \brief Get initial static value for Newton solver in data-driven fluid model. | ||
* \return Initial static value. | ||
*/ | ||
su2double GetInitialEnergy_DataDriven(void) const { return DataDriven_e_init; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make a dedicated struct to store the _DataDriven config options and replace all _DataDriven accessors which are becoming numerous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've replaced the accessors for the CDataDrivenFluid fluid model now with structs. I did a similar thing for the CFluidFlamelet fluid model.
su2double drhode_p = -dPde_rho/dPdrho_e; | ||
su2double dTde_p = dTde_rho + dTdrho_e*drhode_p; | ||
su2double dhde_p = dhde_rho + drhode_p*dhdrho_e; | ||
Cp = dhde_p / dTde_p; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are Cv and Cp local variables? Why are they not preaccumulated? Do you have any adjoint verification cases yet to be playing with preaccumulation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially copied the preaccumulation from the Peng-Robinson fluid model. I added some unit tests for fluid model consistency and I'm planning to add some AD unit tests as well.
void CDataDrivenFluid::Run_Newton_Solver(su2double Y1_target, su2double Y2_target, su2double& Y1, su2double& Y2, | ||
su2double& dY1drho, su2double& dY1de, su2double& dY2drho, su2double& dY2de) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are some of these passed by value and others by non-const reference? Are they outputs?
Why aren't they preaccumulated either as input or output?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They could indeed be passed by const value and const reference, since none of them are outputs. I still need to verify whether I did the preaccumulation correctly.
… to separate structs
…ig accessor functions.
…tructs rather than config accessor functions.
…ations from structs rather than config accessor functions.
Proposed Changes
The data-driven fluid model in SU2 has been upgraded with the ability to use physics-informed neural networks (PINN's) to compute the fluid thermodynamic state for NICFD flows. This functionality was presented during the 2024 SU2 conference and the issues regarding non-physical behavior have been addressed.
The use of PINN makes the data-driven fluid model substantially more robust and efficient for flow and adjoint simulations of flows of fluids in the non-ideal thermodynamic state.
PINN's can be trained using SU2 DataMiner for any fluid or compatible mixture of fluids available in the CoolProp library. An elaborate tutorial integrating SU2 DataMiner with the data-driven fluid solver in SU2 will follow soon!
Related Work
Also added the pressure ramp functionality to the Riemann-type boundary condition.
PR Checklist
Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.
pre-commit run --all
to format old commits.