|
[Sponsors] |
September 20, 2017, 16:22 |
Boundary condition
|
#1 |
New Member
Join Date: Jun 2017
Posts: 11
Rep Power: 9 |
Hello FOAMers,
I want to impose a boundary condition which is an exponential function of the Field. Lets assume that I want to solve Laplace equation for temperature (thermal diffusion in solid). How can I have following boundary conditions? |
|
September 21, 2017, 04:35 |
|
#2 |
New Member
Join Date: Apr 2014
Location: Germany
Posts: 24
Rep Power: 12 |
Hi,
I think the easiest way would be groovyBC. https://openfoamwiki.net/index.php/Contrib/groovyBC Best, Moritz |
|
September 21, 2017, 08:12 |
|
#3 |
Member
Join Date: Feb 2016
Posts: 41
Rep Power: 10 |
Couldn't we just add this to the openfoam build
Sent from my SM-G930V using CFD Online Forum mobile app |
|
September 21, 2017, 20:59 |
|
#4 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16 |
This a robin type boundary condition in OpenFOAM.
Search a little bit before asking. Here is the link: http://www.modlab.lv/docs/2011/OpenF...Vilums_pdf.pdf How to write exponential in boundary condition plus laplace samples see these threads: codedFixedValue boundary condition source term modification in poisson equation does not affect results |
|
September 25, 2017, 15:09 |
|
#5 | |
New Member
Join Date: Jun 2017
Posts: 11
Rep Power: 9 |
Quote:
Thanks Moritz, I tired groovyBC. It works for easier robin type boundary condition such as : k*grad(n,T)+alpha*(T-Tinf)=0; However, for my case I have an exponential function and groovy cannot find the root. |
||
September 25, 2017, 15:17 |
|
#6 | |
New Member
Join Date: Jun 2017
Posts: 11
Rep Power: 9 |
Quote:
Thanks bobi, First example is an ordinary robin boundary condition which is possible by groovy. I have already tried this one. Last link was about source term in Laplace equation. I could not find the application for my case as boundary condition. However, I think I should try codedFixedValue to extract internalField and to find root of boundary equation -[ k*grad(n,T)+exp(alpha*(T-Tinf)) ]- iteratively. Thanks for your help. |
||
September 26, 2017, 14:25 |
|
#7 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16 |
I have written another sample for Robin Type boundary condition without Groovy. Just using the basics of c++ and OpenFoam.
Find it here: Snippet for redefining fixedGradient boundary condition for a patch inside solver |
|
September 27, 2017, 18:26 |
|
#8 | |
Member
Zhiheng Wang
Join Date: Mar 2016
Posts: 72
Rep Power: 10 |
Quote:
Wiith All regards to bobi aka babakFlame for excellent and nice explanation i can Just add few lines scalarField GradT = T.boundaryFieldRef()[patchID].snGrad(); scalarField Tpatch = T.boundaryFieldRef()[patchID]; forAll(GradT,I) { scalar CONV = kappa*GradT[I] - Foam::exp(alpha*(Tpatch - Tinf)); } if it is iterative bc you can add scalar CONVERGE = kappa*GradT[I] - Foam::exp(alpha*(Tpatch - Tinf)); with convergence 10-4 or 10-3 some thing under while loop which will give you Tnew for equation But what is need of k*dT/dn if delta T = 0 at upper domain ???? what you want to find out ???? Here kappa and alpha are assumed to be const for variable add volScalarField& Kapp = thermo.kappa(); use Kappa.boundaryfieldRef()[patchID][faceI] in code or reference it in scalarField as previously done for GradT and Tpatch with thermo as basicThermo or psiReactingThermo object. But Here kdT/dn doent have units same as exp(alpha(T-Tinf)) what you want to find Heat Flux or Temperature satisfies the condition ?? |
||
September 29, 2017, 16:57 |
|
#9 |
New Member
Join Date: Jun 2017
Posts: 11
Rep Power: 9 |
[QUOTE=Zhiheng Wang;665901][QUOTE=babakflame;665758]
Thanks a lot Zhiheng! Actually I have made an example here. My goal was to find the way to impose boundary condition which is a function of Field (exponential func). My Field in fact is not Temperate. I as solving potential field and boundary condition is local current density which linked to potential by Bulter-Volmer equation. Thanks again for your comments and your concern |
|
Tags |
boundaries condition, groovybc, laplacianfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
sliding mesh problem in CFX | Saima | CFX | 46 | September 11, 2021 08:38 |
Centrifugal fan | j0hnny | CFX | 13 | October 1, 2019 14:55 |
Accessing multiple boundary patches from a custom boundary condition file | ripudaman | OpenFOAM Programming & Development | 0 | October 22, 2014 19:34 |
Radiation interface | hinca | CFX | 15 | January 26, 2014 18:11 |
An error has occurred in cfx5solve: | volo87 | CFX | 5 | June 14, 2013 18:44 |