# algebraic equations in OpenFOAM

 Register Blogs Members List Search Today's Posts Mark Forums Read

 July 9, 2020, 10:54 algebraic equations in OpenFOAM #1 New Member   Ali B. Join Date: Mar 2020 Posts: 2 Rep Power: 0 Dear FOAMers, (I'm quite new to the cfd-online forum, so if I asked my question in the wrong forum, please let me know.) I'm also a bit new to CFD and I started using OpenFOAM from a few month ago. Introduction: I am trying to simulate a 2D, transient and multi-region salt adsorption system in OpenFOAM. In one region I have two equations that are a bit strange, to me, and I cannot find a way to implement them in OpenFOAM. There are two PDEs (including an advection-diffusion, and a Poisson) and Two algebraic equations. Equations: The final mathematical formulation leads to these coupled PDEs + algebraic equations. We have: 4 scalar fields: , , , and Constants: PDE 1: PDE 2: Algebraic eq. 1: Algebraic eq. 2: Questions: 1. How to write this equation in my solver's .C file? Basically, I don't know how to add an algebraic equation to OpenFOAM. 2. With the presence of these algebraic equation how to construct a loop for solve? So far i didn't came across with anything helpful in my searches. Please kindly share your ideas, and If possible forward me to some readings and other related posts in the forums. All suggestions are welcome. Warm regards, Ali

 July 10, 2020, 14:29 #2 Member   Carlos Rubio Abujas Join Date: Jan 2018 Location: Spain Posts: 84 Rep Power: 5 Hi Ali, Take a look to this book, it explains how CFD works and how to translate from mathematical expression to a CFD algorithm. Basically you're dealing on different discretization phases to finally assembly a matrix to resolve. And then you have to choose a strategy to solve such a matrix. This book explains the concepts as well as the implementation, so I think suits your needs pretty well. If you need a playground to get familiar to the OpenFoam code I recommend you to take an eye to these tutorials. Good luck!

 July 10, 2020, 15:58 #3 New Member   Ali B. Join Date: Mar 2020 Posts: 2 Rep Power: 0 Hi Carlos, First of all, I want to thank you for your reply. I believe I'm familiar with the very basics of finite volume method. However, I don't understand how to pick the strategy to solve (similar to some algorithm like PISO, I guess). Also thank you for the book recommendation and also the tutorial.