|
[Sponsors] |
April 13, 2021, 12:08 |
Equation implementation in IcoFoam
|
#1 |
New Member
Raoul
Join Date: Apr 2021
Posts: 16
Rep Power: 5 |
Hi everyone, I have recently started working with OpenFoam for my master's thesis. I am also new to C++ (I have already read the documentation up to the classes and done some exercises but obviously there are a lot of things I don't know). It is now quite clear to me how OpenFoam works (especially IcoFoam, that is the solver I have to work with). My problem is that I am not able to find any documentation related to the syntax of complex equations.
For example I am currently trying to substitute the standard momentum equation with the Stokes equation (not a complex one yet): however I don't know how to do that. I would write: - fvm::laplacian(nu, U) - fvm::laplacian(nu, U.T()) (the minus is just so that I don't have to modify anything in the PISO loop) and obviously this does not compile. Is there any good guide/documentation that I can refer to in order to learn the syntax for the equations? I have also already performed the tutorials about adding the energy equation or the scalar passive transport equation but they were useless (strictly talking about the syntax learning). Thank you in advance. |
|
April 13, 2021, 12:24 |
|
#2 |
New Member
Bruno Ramoa
Join Date: Jul 2019
Posts: 18
Rep Power: 6 |
Quote:
Hi, I asked something similar to this recently @ Accessing and clarificaiton of the terms in turbulence.divDevRhoReff(U). However, I did not get any reply. I would say that you should implement this as: Code:
+( - fvc::div(nu* fvc::grad(U)().T() ) - fvm::laplacian(nu, U) ) |
|
April 14, 2021, 04:32 |
|
#3 |
New Member
Raoul
Join Date: Apr 2021
Posts: 16
Rep Power: 5 |
Thank you very much for you answer, the implementation that you suggested works.
I am now trying to modify that to understand what I can and cannot do and it looks like that whenever I have to perform some kind of operation concatenation (for example transposing a vector inside another operator) I must write it as "fvc" despite it being an unknown, and to rely on the convergence of the overall solving routine. |
|
Tags |
equation implementation |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Source Term due to evaporation in energy transport equation | styleworker | OpenFOAM Programming & Development | 3 | September 7, 2022 03:09 |
Radiation Models in General and the P1 implementation | Tobi | OpenFOAM Running, Solving & CFD | 8 | September 21, 2021 05:59 |
Adjoint Implementation Equation | FlyBob91 | OpenFOAM Programming & Development | 0 | December 1, 2016 09:50 |
Equation discretisation in icoFoam | kar | OpenFOAM Running, Solving & CFD | 3 | February 10, 2008 06:34 |