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

Modeling delta function as source

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 30, 2012, 19:02
Default Modeling delta function as source
  #1
Senior Member
 
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18
nandiganavishal is on a distinguished road
Hi Foamers,

I would like to know if it is possible to include a delta function as
a source term in OpenFOAM. For instance, I would like to implement,

div(a*gradient(phi)) = -a_0*(c+(d*delta(x-x_c)))

where x_c is the position corresponding to the nodal point where delta
function is singular and the position changes at every time step.

Please let me know if we can implement this in OpenFOAM.

Thanks

Regards
Vishal
nandiganavishal is offline   Reply With Quote

Old   February 27, 2015, 06:55
Default
  #2
New Member
 
Jim
Join Date: Feb 2014
Location: UK
Posts: 22
Rep Power: 12
jimteb is on a distinguished road
Hi Vishal,

I was wondering if you found an answer to this?

thanks
jimteb is offline   Reply With Quote

Old   February 27, 2015, 13:42
Default
  #3
New Member
 
Join Date: Feb 2014
Posts: 24
Rep Power: 12
hajott is on a distinguished road
I assume, that you mean the dirac distribution by delta(x-x0).
You can approximate delta by a field that has the value 1/V in the grid cell containing x0 and 0 elsewhere, resulting in:
integral(f(x)delta(x-x0))dV=f(x0).

For a more accurate solution you may need to implement a jump boundary condition and split your mesh on each "side" of x0.
hajott is offline   Reply With Quote

Old   February 28, 2015, 09:37
Default
  #4
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 13
ssss is on a distinguished road
You can create a volScalarField filled with 0s. Then loop over the cells and check which one of them satisfy the delta condition, so that you can change their values to 1
ssss 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
wmake compiling new solver mksca OpenFOAM Programming & Development 14 June 22, 2018 07:29
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc ofslcm OpenFOAM Community Contributions 25 March 6, 2017 11:03
[Gmsh] Compiling gmshFoam with OpenFOAM-1.5 BlGene OpenFOAM Meshing & Mesh Conversion 10 August 6, 2009 05:26
Compilation errors in ThirdPartymallochoard feng_w OpenFOAM Installation 1 January 25, 2009 07:59
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 21:50


All times are GMT -4. The time now is 08:28.