CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

algebraic equations in OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 9, 2020, 11:54
Default algebraic equations in OpenFOAM
  #1
Member
 
Ali B.
Join Date: Mar 2020
Location: abzrg.github.io
Posts: 44
Rep Power: 6
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.

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: 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})
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
reverseila is offline   Reply With Quote

Old   July 10, 2020, 15:29
Default
  #2
Senior Member
 
Carlos Rubio Abujas
Join Date: Jan 2018
Location: Spain
Posts: 127
Rep Power: 11
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, 16:58
Default
  #3
Member
 
Ali B.
Join Date: Mar 2020
Location: abzrg.github.io
Posts: 44
Rep Power: 6
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

Reply

Tags
advection-diffusion, algebraic equations, poisson equation


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
Energy equations in OpenFoam Bloerb OpenFOAM Running, Solving & CFD 9 July 1, 2024 14:22
OPENFOAM for Aeroacoustics simulations (using Linearized Euler Equations) ms518 OpenFOAM 6 February 21, 2021 17:49
KOmegaSS Equations in OpenFOAM ? losiola OpenFOAM 3 October 10, 2019 09:55
OpenFOAM 4.0 Released CFDFoundation OpenFOAM Announcements from OpenFOAM Foundation 2 October 6, 2017 06:40
UNIGE February 13th-17th - 2107. OpenFOAM advaced training days joegi.geo OpenFOAM Announcements from Other Sources 0 October 1, 2016 20:20


All times are GMT -4. The time now is 09:12.