|
[Sponsors] |
Source terms on multiple domains - best practice? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 31, 2017, 20:09 |
Source terms on multiple domains - best practice?
|
#1 |
New Member
Join Date: Dec 2016
Posts: 8
Rep Power: 9 |
Hello,
I have a simulation with three domains - one fluid and two solids that all share interfaces. I need to apply a general source term to the entire simulation (energy deposition from high energy particles). I have the energy data in a large CSV (1.2 million rows) in X, Y, Z, watt/m^3 format (this covers all domains). I have imported this data as a User Function and am calling the user function within an expression. I am then creating a sub-domain in each of my domains, enabling an energy source, and selecting my expression. I've checked that the expression plots the correct power densities I expect. My issue comes when I try to write a .def file, it seems to take an exorbitant amount of time. Is there a more computationally efficient method to implement the source terms I need? Thanks! |
|
April 1, 2017, 06:58 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144 |
Does the def file write quickly when you do not have the source term? How many nodes in you mesh?
|
|
April 1, 2017, 15:31 |
|
#3 |
New Member
Join Date: Dec 2016
Posts: 8
Rep Power: 9 |
||
April 1, 2017, 20:30 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144 |
Puzzling. It might be creating a table for the source term and that would take some time with a large field like that. But I did not think it did that with user fortran stuff.
If you make a simple source term, maybe with only a few hundred values, does that run quickly? Is the file size of the def file with the source term bigger than with no source term? |
|
October 19, 2017, 18:41 |
|
#5 |
New Member
Join Date: Dec 2016
Posts: 8
Rep Power: 9 |
An update to those googling with similar issues:
The source term array was simply much too large. I made multiple arrays with appropriate binning density in my particle tracking code, to cut down on the total number of data points while still having the necessary density where it counts. The .def file writes fine with less function data to interpolate. Another option would be to do the interpolation in another program like Matlab and get an approximate function to use that way. |
|
Tags |
cfx-pre, source energy term |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
GPU Linear Solvers for OpenFOAM | gocarts | OpenFOAM Announcements from Other Sources | 37 | August 17, 2022 15:22 |
[OpenFOAM.org] Patches to compile OpenFOAM 2.2 on Mac OS X | gschaider | OpenFOAM Installation | 136 | October 10, 2017 18:25 |
[Other] How to use finite area method in official OpenFOAM 2.2.0? | Detian Liu | OpenFOAM Meshing & Mesh Conversion | 4 | November 3, 2015 04:04 |
Trouble compiling utilities using source-built OpenFOAM | Artur | OpenFOAM Programming & Development | 14 | October 29, 2013 11:59 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 02:24 |