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

How to add particle forces in user lib?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By xuegy
  • 1 Post By raumpolizei

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 26, 2021, 09:55
Default How to add particle forces in user lib?
  #1
Member
 
Join Date: Jun 2016
Posts: 99
Rep Power: 9
xuegy is on a distinguished road
I created a new particle force which it's in
Code:
src/lagrangian/intermediate/submodels/Kinematic/ParticleForces
and works well. Also
Code:
src/lagrangian/intermediate/parcels/include/makeThermoParcelForces.H
is modified.
Here's my question: is there any way to do this externally. In some scenarios, for example HPC, I don't have write permission to the system version and have to compile my own OpenFOAM in order to add particle forces.
sourav90 likes this.
xuegy is offline   Reply With Quote

Old   May 5, 2021, 07:16
Default
  #2
Member
 
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 7
raumpolizei is on a distinguished road
Yes, it is quite forward. Define your force as you did in a new folder and create a novel makeNovelThermoParcelForces.H and only include your new force in that header. Use a different name for the macro, since it is already defined in the makeThermoParcelForces.H. Finally, you need to create a new file, for instance makeNovelThermoParcelSubmodels.C:
Code:
#include "basicThermoCloud.H"
#include "makeNovelThermoParcelForces.H"
 makeNovelThermoParcelForces(basicThermoCloud); // name of the macro defined in makeNovelThermoParcelForces.H
For a better overview, try to keep the same structure as in the your OF/src. Then, change your Make/file and Make/options. Of course, you have to include the lagrangian intermediate library in your Make/options in order to make it work. You can then either link the library at runtime in your controlDict or add it to your specific application Make/options.

Good luck. RP
sourav90 likes this.
raumpolizei is offline   Reply With Quote

Old   June 14, 2022, 13:12
Default
  #3
Member
 
Join Date: Jun 2016
Posts: 99
Rep Power: 9
xuegy is on a distinguished road
Quote:
Originally Posted by raumpolizei View Post
Yes, it is quite forward. Define your force as you did in a new folder and create a novel makeNovelThermoParcelForces.H and only include your new force in that header. Use a different name for the macro, since it is already defined in the makeThermoParcelForces.H. Finally, you need to create a new file, for instance makeNovelThermoParcelSubmodels.C:
Code:
#include "basicThermoCloud.H"
#include "makeNovelThermoParcelForces.H"
 makeNovelThermoParcelForces(basicThermoCloud); // name of the macro defined in makeNovelThermoParcelForces.H
For a better overview, try to keep the same structure as in the your OF/src. Then, change your Make/file and Make/options. Of course, you have to include the lagrangian intermediate library in your Make/options in order to make it work. You can then either link the library at runtime in your controlDict or add it to your specific application Make/options.

Good luck. RP
Hello,

Sorry I forgot about this problem when I was thinking about it. Now I really need to implement it and I followed your instructions. However my particle force is not available in the hash table. Would you mind provide a minimum working example? Thanks.
xuegy 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
The CoP Does not exist: Validating Aerodynamic forces through a "line of action" ds4719 Main CFD Forum 14 February 18, 2022 18:05
Is it able to use utility to output particle forces during timestep? zhangxc0223 OpenFOAM Running, Solving & CFD 1 April 30, 2020 03:30
Particle Forces in LPT using MPPICFoam saiguruprasad OpenFOAM Post-Processing 0 January 2, 2020 06:17
add user scalar in one phase zhu CFX 0 April 27, 2002 03:45
add user scalar and modify pressure btzhu CFX 0 April 11, 2002 22:09


All times are GMT -4. The time now is 02:51.