CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Specify transport properties using function2 object in OpenFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 7, 2023, 06:56
Default Specify transport properties using function2 object in OpenFoam
  #1
New Member
 
Harish Gopal
Join Date: Mar 2023
Posts: 4
Rep Power: 3
HarishZHAW is on a distinguished road
Hi All,


I hope you are having a great day !


For my research, I am computing the response of laminar premixed flames to acoustic forcing. I am then changing various fuels to see the effect of different fuels on the flame dynamics.


For computing the diffusive mass and energy fluxes, I am using the Fickian model where one needs to specify the binary or mixture averaged diffusion coefficients. The binary diffusion coefficients can be extracted from literature or CHEMKIN or Cantera, where they are written down in terms of a polynomial expansion. In other words,


ln(D_ij) = A_0 + A_1 ln(T) + A_2 ln(T)^2 + ...


My question is how do I specify this in Openfoam. In the Fickian.H file the following is written: "The mixture diffusion coefficients are specified as Function2<scalar>s of pressure and temperature but independent of composition."


Please, can anyone instruct me how to use this Function2<scalar> object. More specifically, how do I instruct OpenFoam to know that D_ij will be of the above form in terms of temperature. Any suggestions would be great please.


Thanks,


Harish.
HarishZHAW is offline   Reply With Quote

Old   July 7, 2023, 07:35
Default
  #2
Member
 
JuanMi
Join Date: Nov 2017
Posts: 41
Rep Power: 8
keitaro7_14 is on a distinguished road
All you need to understand Function2 is here:


https://github.com/OpenFOAM/OpenFOAM...ions/Function2


Function2 is a template class which admit 2 arguments and return 1. The logic behind is programmed in its derived classes.


In OF case, the mixture diffusion parameters depend on that, pressure and temperature, and for that reason is a Function2.


If you have an expression for that relationship, and it only depends on the temperature, I would use the coded version.


Only you need is, in the thermophysicalTransport dictionary, introduce that relationship when you define the variable Dm, for example.


The use of coded would be something similar to this: Coded boundary condition


To begin, try to mimic other Function2 as this: https://github.com/OpenFOAM/OpenFOAM...nt/Constant2.H
keitaro7_14 is offline   Reply With Quote

Old   July 16, 2023, 10:08
Default
  #3
New Member
 
Harish Gopal
Join Date: Mar 2023
Posts: 4
Rep Power: 3
HarishZHAW is on a distinguished road
Hi JuanMi,


Super ! Thanks a lot for your quick response.


Yes, you right, the coded function object seems to be the best option. However, I was not very confident of my coding skills and therefore, I implemented it using the table 2 function object. This is the format that I have for specifying the transport properties in the thermophysicalTransport file:


OH-H
{
type uniformTable;

low (91192.5 200.0);
high (151987.5 3000.0);

values
10 20
(
(9.376082804843815e-05 0.00025530938139315393 0.00047145082144682174 0.0007348424533524699 0.0010410077644183143 0.0013868237506628248 0.0017699361503138813 0.002188478205786576 0.002640916115086698 0.0031259559832085212 0.003642483925028823 0.004189525479741268 0.004766216970381311 0.005371784614578548 0.0060055288661967346 0.006666812404327898 0.0073550507369047535 0.008069704723696992 0.00881027453768912 0.009576294724034665 )
(8.72945640450976e-05 0.0002377018378487985 0.00043893697169186853 0.0006841636634660926 0.0009692141254929134 0.0012911807333757335 0.001647871588223269 0.002037548674353019 0.0024587839692186498 0.002910372811952761 0.0033912781370958006 0.0039005926880349736 0.004437512351734324 0.005001316710124855 0.005591354461631442 0.006207032238512181 0.006847805858497529 0.007513173363442027 0.008202669397158836 0.008915860605135722 )
(8.166265668734935e-05 0.0002223662354069405 0.0004106184573891673 0.0006400240722747318 0.0009066841819127253 0.0012078787505772988 0.0015415572922088641 0.001906093921168953 0.0023001527453980915 0.0027226068240848405 0.003172485999218652 0.0036489415468714263 0.004151221232267593 0.004678651115923251 0.005230621915719736 0.005806578545704943 0.006406011932142849 0.007028452501284476 0.007673464919922781 0.008340643791901158 )
(7.671340476690394e-05 0.0002088894938671259 0.0003857324902746723 0.0006012347345611117 0.0008517336254331662 0.0011346739778150382 0.001448129577529539 0.0017905730774617436 0.002160749548707298 0.002557600349897881 0.0029802141204781276 0.0034277935743337643 0.0038996320666756174 0.004395096502836994 0.004913614526888236 0.005454664694450098 0.0060177687847402525 0.006602485683024811 0.007208406439927461 0.007835150228755633 )
(7.232978163736657e-05 0.000196952951360433 0.0003636906336875482 0.0005668784640147624 0.000803063132551271 0.0010698354647970362 0.0013653793159564226 0.0016882546158925012 0.0020372781459240237 0.0024114517584751445 0.0028099161707365204 0.0032319196558004064 0.003676795948579868 0.004143948131246308 0.004632836553923194 0.005142969569052949 0.005673896282755095 0.006225200786851965 0.006796497500503034 0.007387427358541026 )
(6.842006371102243e-05 0.0001863068458814907 0.00034403168051524833 0.0005362363848788294 0.0007596543145755267 0.0010120065207539532 0.0012915750286074269 0.0015969976096280418 0.001927155002901104 0.002281103014773786 0.002658028810156168 0.0030572212960274115 0.003478050221629605 0.003919950934962725 0.004382412956413833 0.004864971213969007 0.005367199186389955 0.00588870344702213 0.006429119257232601 0.006988106960782053 )
(6.491134249507257e-05 0.00017675264865679886 0.00032638903023241505 0.0005087370830901715 0.000720697683058833 0.0009601087504588787 0.001225340411755764 0.0015151002963137833 0.001828326541213868 0.0021641233729905148 0.0025217196404045696 0.0029004407167439548 0.003299688671802446 0.0037189278100928412 0.004157673830443893 0.004615485510688544 0.005091958202472522 0.005586718654867148 0.006099420833784775 0.006629742501254768 )
(6.174493554409342e-05 0.000168130568234516 0.0003104676141235168 0.0004839206400126021 0.0006855416985193778 0.0009132741772657627 0.0011655677087432877 0.0014411929647862817 0.0017391398806668498 0.002058556379186099 0.0023987089262384933 0.0027589558037320544 0.0031387282487876926 0.0035375166974053853 0.003954860472861264 0.004390339876020811 0.004843569997473862 0.005314195793654117 0.005801888110185518 0.006306340428022828 )
(5.887307807692628e-05 0.00016031054180500363 0.00029602725997823694 0.00046141270326782995 0.0006536560381231277 0.0008707963085557272 0.0011113552571738324 0.0013741607338659894 0.0016582496536590894 0.001962809570851862 0.0022871410692041445 0.0026306322779770753 0.0029927408883789627 0.003372981037060949 0.0037709134741235307 0.004186138021322169 0.004618287672009962 0.005067023896274856 0.005532032849246657 0.0060130222685799055 )
(5.6256496829062894e-05 0.00015318562883589237 0.0002828704928680931 0.00044090547201148194 0.0006246046586509886 0.0008320942503976949 0.0010619616901883287 0.0013130869234719456 0.0015845496690520188 0.0018755735899251128 0.0021854903550172938 0.0025137152878447607 0.0028597301822287867 0.003223070768747129 0.0036033173197180406 0.004000087442596739 0.004413030442142852 0.004841822834218195 0.005286164722613472 0.005745776834420799 )
);
}


In the above, I have specified the binary diffusion coefficient for the species pair OH-H in terms of the two dimensional table as a function of pressure and temperature. The pressure varies along the row, while the temperature varies along the column. The low and high values signify the



Hope this helps you and all others.


Thanks and have a nice day !


Harish
HarishZHAW is offline   Reply With Quote

Old   February 17, 2024, 09:07
Default
  #4
New Member
 
Join Date: Nov 2022
Posts: 2
Rep Power: 0
Eigen is on a distinguished road
Hi Harish,

Can you please verify whether or not your method works as expected?
Eigen is offline   Reply With Quote

Reply


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
Simulation DNS for two phase flow in openFoam ht2017 OpenFOAM Running, Solving & CFD 0 December 8, 2020 05:50
OpenFOAM Training Jan-Jul 2017, Virtual, London, Houston, Berlin CFDFoundation OpenFOAM Announcements from Other Sources 0 January 4, 2017 06:15
OpenFOAM Training Jan-Apr 2017, Virtual, London, Houston, Berlin cfd.direct OpenFOAM Announcements from Other Sources 0 September 21, 2016 11:50
Thermophysical properties for natural convection Ciefdi OpenFOAM Running, Solving & CFD 0 November 7, 2013 11:44
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 07:36


All times are GMT -4. The time now is 21:52.