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

Writing a piece of code in OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 17, 2019, 01:45
Default Writing a piece of code in OpenFOAM
  #1
New Member
 
Join Date: Apr 2018
Posts: 17
Rep Power: 8
dela is on a distinguished road
Hello All,

Please I want to add the attached equations as a momentum source to my reactingTwoPhaseEulerFoam's Ueqn but I don't know how to write the code in OpenFOAM

Below is what I have done:

[volScalarField Kdg = 1.9*160*pow(as,2)*phase1.mu()/(36*0.95)+(1.37*0.16*as*alpha1*rho1*mag(U1)/(6*0.95)); //effective interfacial area per unit volume
volScalarField Kdl = 1.9*160*pow(as,2)*0.95*phase2.mu()/(36*pow(alpha2,2)+1)+(1.37*0.16*as*0.95*rho2*mag(U 2)/(6*alpha2+1));

volVectorField Udg = -f*mag(U1)*fvc::grad(alpha1)/(alpha1+1); //drift velocity, gas phase

volScalarField Kd(fluid.Kd());

volVectorField Udl = -f*mag(U2)*fvc::grad(alpha2)/(alpha2+1); // drift velocity, liquid phase

volVectorField F1 = alpha1*Kdg*Udg+0.95*Kd*(Udg-Udl); //gas dispersion force

volVectorField F2 = (alpha2+1)*Kdl*Udl;//-0.95*Kd*(Udg-Udl); //liquid dispersion force]
Attached Images
File Type: png eqn1.PNG (9.8 KB, 12 views)
File Type: png eqn2.PNG (6.5 KB, 10 views)
File Type: png eqn3.PNG (7.2 KB, 8 views)
dela 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
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 05:38
OpenFOAM Training Jan-Apr 2017, Virtual, London, Houston, Berlin cfd.direct OpenFOAM Announcements from Other Sources 0 September 21, 2016 11:50
[OpenFOAM.org] A Mac OS X of23x Development Environment Using Docker rt08 OpenFOAM Installation 1 February 28, 2016 19:00
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 wyldckat OpenFOAM Announcements from Other Sources 3 September 8, 2010 06:25
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 15:56


All times are GMT -4. The time now is 10:47.