|
[Sponsors] |
March 26, 2018, 02:10 |
How to use the functionobjects add?
|
#1 |
New Member
Bingchuan
Join Date: Dec 2017
Posts: 16
Rep Power: 9 |
Dear foamer,
The manual says that the functionobjects add can be used to " Add a list of fields." At the same time, the code gives an example as Code:
Ttot { type add; libs ("libfieldFunctionObjects.so"); fields (T Tdelta); result Ttot; executeControl writeTime; writeControl writeTime; } Bests. Bingchuan |
|
March 26, 2018, 13:43 |
|
#2 | |
Member
Hosein
Join Date: Nov 2011
Location: Germany
Posts: 94
Rep Power: 15 |
Quote:
I think you forgot to read the next line which states "The operation can be applied to any volume or surface fields generating a volume or surface scalar field." I think this is quite clear about what this class does. |
||
March 27, 2018, 09:03 |
|
#3 |
New Member
Bingchuan
Join Date: Dec 2017
Posts: 16
Rep Power: 9 |
Dear Hosein,
Thank you for your reply. In fact, I have read "The operation can be applied to any volume or surface fields generating a volume or surface scalar field " before. Since I am new with OF, it is still confusing for me. I was wondering: 1) Does it have the same efficacy with the VolVectorField or VolScalarField in the creatFields.H? 2) If I created a field by the functionobject add, say a field XX which is related to the temperature. I think the calculation expression of XX should defined in the code. Where should I define the calculation expression of XX ? So, could you please give me more details, such as sharing an example? Many Thanks. Bests, Bingchuan |
|
March 27, 2018, 10:09 |
|
#4 | |
Member
Hosein
Join Date: Nov 2011
Location: Germany
Posts: 94
Rep Power: 15 |
Hey there,
I think you mixed up some things with each other. To see what function objects do in general you might refer to this page "https://cfd.direct/openfoam/user-guide/v3-function-objects/". Quote:
Going back to our function object "add", this will add two or more scalar fields with each other. So this means you need to have a volScalarField (exp. temperature as it is stated in the example) defined either on a volume region or a surface one, to add them. The calculation that you referred, here is addition. |
||
March 28, 2018, 05:48 |
|
#5 |
New Member
Bingchuan
Join Date: Dec 2017
Posts: 16
Rep Power: 9 |
Dear Hosein,
I got it The add function object is just to create a new field which is a sum of a few existing variables. I got it mixed up with registering a new field. Thanks. Bests, Bingchuan |
|
June 6, 2020, 15:03 |
|
#6 |
Member
Himanshu
Join Date: Jan 2017
Posts: 34
Rep Power: 9 |
||
June 6, 2020, 17:36 |
|
#7 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
Hope this helps: https://www.openfoam.com/documentati...field-add.html
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
June 8, 2020, 13:41 |
|
#8 | |
Member
Himanshu
Join Date: Jan 2017
Posts: 34
Rep Power: 9 |
Quote:
Thank you for the quick reply. I have seen that page but as I am new to oF and currently in learning phase, I have some doubts and was not able to understand clearly from that page. Hence, I asked for an example to understand better. If you allow, Can I asked few question regarding function object. I swear those are easy doubts but not for me |
||
June 8, 2020, 17:24 |
|
#9 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13 |
Hi,
A minimal example might be, say you want to add two fields of the same size and dimensions, X and Y: Code:
add1 { type add; libs (fieldFunctionObjects); fields (X Y); } Code:
functions { add1 { type add; libs (fieldFunctionObjects); fields (X Y); } }
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
June 9, 2020, 11:08 |
|
#10 | |
Member
Himanshu
Join Date: Jan 2017
Posts: 34
Rep Power: 9 |
Quote:
Thank you for the example. I just read many post last night and many of doubts were solved. Thanks! |
||
Tags |
add, functions |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] refineWallLayer Error | Yuby | OpenFOAM Meshing & Mesh Conversion | 2 | November 11, 2021 12:04 |
decomposePar problem: Cell 0contains face labels out of range | vaina74 | OpenFOAM Pre-Processing | 37 | July 20, 2020 06:38 |
[PyFoam] and paraview | eelcovv | OpenFOAM Community Contributions | 28 | May 30, 2016 10:23 |
[DesignModeler] add two area around Cylinder in ansys | sajjadcheraghian | ANSYS Meshing & Geometry | 0 | May 23, 2016 13:42 |
OpenFOAM v1.6 & OpenMPI & functionObjects | bruce | OpenFOAM Running, Solving & CFD | 1 | August 7, 2009 14:15 |