|
[Sponsors] |
Boundary condition with value, gradient and constant/source term |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 25, 2022, 16:03 |
Boundary condition with value, gradient and constant/source term
|
#1 |
New Member
Arman N
Join Date: Mar 2019
Posts: 13
Rep Power: 7 |
Hello everyone,
I need to implement a boundary condition which is a combination of the value and gradient of a parameter with a constant/source term. For example, for parameter the desired equation at boundary is as follows: where , , and are constants. I wanted to know if there is any BC already available in openFoam for this purpose and if not, how can this be achieved. *PS: I know this can be somehow implemented using the mixed BC when , but I need the more general approach. Any hint is appreciated. Arman |
|
February 1, 2022, 12:27 |
|
#2 |
New Member
Join Date: May 2021
Posts: 5
Rep Power: 5 |
Hi Arman,
You can achieve this by using codeStream. Use codedFixedValue, include necesary libraries and <#include "fvCFD.H"> in the required header files. You can use most of the functions provided in openfoam by this BC. Here is the link for template: https://www.openfoam.com/documentati...xed-value.html |
|
February 5, 2022, 08:43 |
Solved!
|
#3 |
New Member
Arman N
Join Date: Mar 2019
Posts: 13
Rep Power: 7 |
Hi "abhishekmonu96`",
Thanks for your reply. I'm not really familiar with codeStream but I assume it is an efficient way to tweak your way into custom BCs. I will give it a try! *UPDATE: After all, I did some more searching and found that apparently, wallHeatTransfer BC does something similar to what I'm looking for, which is itself based on the mixed BC. Thank to this post, I was able to figure out how it works and apply my own BC. The mixed BC calculates the value on patch using the following equation: where is valueFraction, is refValue, is the cell internal value next to face, is refGrad, and is the distance between cell face and cell center (=1/deltaCoeffs()). The main idea is to replace the derivative term with its linear approximation. Therefore, the equation becomes: reordering into the mixed BC form gives: Therefore, by assuming , , and , one can implement the desired boundary condition similar to wallHeatTransfer BC. Cheers, |
|
Tags |
boundary condition, boundary gradient, boundary value, mixed boundary condition, source term |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Boundary condition with value, gradient and constant | Arman_N | OpenFOAM Programming & Development | 0 | January 25, 2022 15:50 |