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

Adding a body force to the NSE in a solver

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 5, 2024, 06:13
Default Adding a body force to the NSE in a solver
  #1
Member
 
Divyaprakash
Join Date: Jun 2014
Posts: 69
Rep Power: 11
Divyaprakash is on a distinguished road
I need to do the following.


I have a force that needs to implemented at various locations in the computational domain. This force I am calculating through some other program.



Let's say I write a text file which has the forces defined at all the locations corresponding to the mesh cell centers.



Is it possible to read this file and add it to the discretized equations of let's say PisoFOAM solver as a body force? At every timestep?



Please let me know if such a thing is possible in OpenFOAM. I would then venture further on how it could be done. Also please provide some guidance if tools exist to readily implement this into the solver.
Divyaprakash is offline   Reply With Quote

Old   March 6, 2024, 03:54
Default
  #2
Senior Member
 
Domenico Lahaye
Join Date: Dec 2013
Posts: 736
Blog Entries: 1
Rep Power: 17
dlahaye is on a distinguished road
https://www.openfoam.com/documentati...s-sources.html

Good luck.
dlahaye is offline   Reply With Quote

Old   March 9, 2024, 04:02
Default
  #3
Member
 
Divyaprakash
Join Date: Jun 2014
Posts: 69
Rep Power: 11
Divyaprakash is on a distinguished road
Quote:
Originally Posted by dlahaye View Post

This isn't exactly what I need but thanks anyway. I was looking to implement it directly inside the source code.
Divyaprakash is offline   Reply With Quote

Old   March 10, 2024, 07:06
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 670
Rep Power: 14
Tobermory will become famous soon enough
Quote:
Originally Posted by Divyaprakash View Post
Let's say I write a text file which has the forces defined at all the locations corresponding to the mesh cell centers.

Is it possible to read this file and add it to the discretized equations of let's say PisoFOAM solver as a body force? At every timestep?
Yes - just make sure that the data is stored in OpenFOAM format, read it in as a field and apply it as an extra source term in the momentum equation. The first step is probably going to be the hardest one for you.
Tobermory is offline   Reply With Quote

Reply

Tags
body force, pisofoam


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
attachmentPt for floating body at each time step for overInterDyMFoam solver mahsankhan OpenFOAM Running, Solving & CFD 0 January 24, 2022 11:13
interFOAM, how to define body force and force on interface Prosper OpenFOAM Pre-Processing 3 June 17, 2021 09:56
ActuatorDiskExplicitForce in OF2.1. Help be_inspired OpenFOAM Programming & Development 10 September 14, 2018 11:12
conjugateHeatFoam + interFoam farhagim OpenFOAM Programming & Development 15 July 19, 2016 07:55
Force on moving body joechorn Fluent UDF and Scheme Programming 5 April 2, 2015 11:25


All times are GMT -4. The time now is 06:33.