|
[Sponsors] |
May 29, 2013, 22:52 |
Source term in solveTransportPDE
|
#1 |
Senior Member
|
Hi,
I have been playing with the "solveTransportPDE" function - which I think is part of swak4Foam - to add passive scalars when using simpleFoam. I use syntax similar to the following [taken from one of the example]: It is working great. I was looking at trying to specify sources using algebraic expression - such as nominated a source term at a given spatial location (and probably ramping it up in time) for example. I was wondering if anyone had experienced with it/guidance on how to construct the source term. Is multiple line expression allowed? I was also wondering if the fieldName had to match with the function name? Thanks in advance for any help/pointer. Julien
__________________
--- Julien de Charentenay Last edited by julien.decharentenay; May 29, 2013 at 22:56. Reason: Changed type for the code extract, and correct alignment |
|
June 5, 2013, 20:55 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Basically in the source term you can do anything you can do with other swak-expressions (so something like "mag(pos()-vector(1,0,0))<0.1 ? (time()<1 ? time() : 1)*42 : 0" would for instance give you a source in a circle around (1,0,0) that grows until t=1 and then stays constant Multiline: with a variable list you can make this more "structured". BTW: variable are shared between the expressions (rho, diffusion, source, phi): that might help you to make it more consistent
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
June 6, 2013, 00:32 |
|
#3 | |
Senior Member
|
Thanks a lot. It is exactly the information I was looking to hear.
Quote:
Code:
functions { TCompare { type solveTransportPDE; outputControl timeStep; outputInterval 1; solveAt timestep; fieldName TCompare; steady false; rho "1" [0 0 0 0 0 0 0]; diffusion "0.01" [0 2 -1 0 0 0 0]; source "0" [0 0 -1 1 0 0 0]; phi "phi" [0 3 -1 0 0]; } I was wondering if the two had to match or if one could nominate a fieldName different from the function name?
__________________
--- Julien de Charentenay Last edited by julien.decharentenay; June 6, 2013 at 00:34. Reason: Trying to clarify my question |
||
June 6, 2013, 06:53 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem of SOURCE term gradient in UDS | wind | Fluent UDF and Scheme Programming | 6 | December 1, 2022 15:21 |
GPU Linear Solvers for OpenFOAM | gocarts | OpenFOAM Announcements from Other Sources | 37 | August 17, 2022 15:22 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 14:59 |
UDF source term | jerome_ | FLUENT | 2 | July 11, 2011 12:55 |
UDFs for Scalar Eqn - Fluid/Solid HT | Greg Perkins | FLUENT | 0 | October 11, 2000 04:43 |