CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

algebraic equations in OpenFOAM

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

LinkBack Thread Tools Search this Thread Display Modes
Old   July 9, 2020, 10:54
Default algebraic equations in OpenFOAM
New Member
Ali B.
Join Date: Mar 2020
Posts: 2
Rep Power: 0
reverseila is on a distinguished road
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.

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.
The final mathematical formulation leads to these coupled PDEs + algebraic equations. We have:
  • 4 scalar fields: c, w, \phi, and q
  • Constants: C_{1..8}
  • PDE 1:
{\partial c \over \partial t} +  {C_1} {\nabla^{2}c} = C_2 {\partial w  \over \partial t}
  • PDE 2:
\nabla \cdot (c \nabla \phi) = { C_3} { \partial q \over \partial t}
  • Algebraic eq. 1:
w^2 = q^2 + C_4\ c^2
  • Algebraic eq. 2:
\phi = C_5 + C_6\ q - C_7\ sinh^-1(C_8{q \over c})

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,
reverseila is offline   Reply With Quote

Old   July 10, 2020, 14:29
Carlos Rubio Abujas
Join Date: Jan 2018
Location: Spain
Posts: 84
Rep Power: 5
crubio.abujas is on a distinguished road
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!
crubio.abujas is offline   Reply With Quote

Old   July 10, 2020, 15:58
New Member
Ali B.
Join Date: Mar 2020
Posts: 2
Rep Power: 0
reverseila is on a distinguished road
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.
reverseila is offline   Reply With Quote


advection-diffusion, algebraic equations, poisson equation

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
KOmegaSS Equations in OpenFOAM ? losiola OpenFOAM 3 October 10, 2019 08:55
Energy equations in OpenFoam Bloerb OpenFOAM Running, Solving & CFD 8 February 3, 2018 10:36
OpenFOAM 4.0 Released CFDFoundation OpenFOAM Announcements from OpenFOAM Foundation 2 October 6, 2017 05:40
OPENFOAM for Aeroacoustics simulations (using Linearized Euler Equations) ms518 OpenFOAM 5 September 6, 2017 11:09
UNIGE February 13th-17th - 2107. OpenFOAM advaced training days joegi.geo OpenFOAM Announcements from Other Sources 0 October 1, 2016 19:20

All times are GMT -4. The time now is 03:29.