|
[Sponsors] |
June 27, 2014, 10:53 |
coded function object and field average
|
#1 |
Member
Matthias Walter
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 63
Rep Power: 17 |
Hi folks,
I'm using the coded function object to create and calculate the field epsilon Code:
epsilonAverage { functionObjectLibs ("libutilityFunctionObjects.so"); type coded; redirectType average1; outputControl timeStep; code #{ volScalarField epsilon ( IOobject ( "epsilon", mesh().time().timeName(), mesh(), IOobject::NO_READ, IOobject::AUTO_WRITE ), 2*mesh().lookupObject<volScalarField>("nu")*magSqr(symm(fvc::grad(mesh().lookupObject<volVectorField>("U")))) ); //epsilon.write(); #}; } So is it possible to use the fieldAverage function object for this purpose? (Of course I can implement the code into the solver directly but using the coded function object I must not change the solver) Best regards Matthias |
|
June 28, 2014, 16:42 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Matthias,
I'm not certain I understand the problem you're describing, but my understanding is that you're using something like the utility execFlowFunctionObjects and using that function object to calculate the average of epsilon field!? The part I'm not certain is why you're using a coded function object... OK, there are two possible answers, from what I can figure out from your question:
Bruno
__________________
|
|
June 30, 2014, 05:41 |
|
#3 |
Member
Matthias Walter
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 63
Rep Power: 17 |
Hi Bruno,
actually I don't use the execFlowFunctionObjects. My intention was to calculate the dissipation field (epsilon) on-the-fly without modifying the solver. I can calculate the epsilon field in system/controlDict using the coded function object but how does the averaging work? After the coded function object has been finished the epsilon field can be written to disk but it is not registered! If you call the averaging function object after coded function object it won't find a field named epsilon. I will have a look at execFlowFunctionObjects if it will do the job. Best regards Matthias |
|
June 30, 2014, 05:52 |
create registered object during runtime using functionobject
|
#4 |
Senior Member
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 18 |
Hi Matthias
Have a look into this thread: http://www.cfd-online.com/Forums/ope...ionobject.html In post #12 (http://www.cfd-online.com/Forums/ope...tml#post387459) Eelco explains the solution to his problem using functionobjects. Cheers Fabian |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
y+ and u+ values with low-Re RANS turbulence models: utility + testcase | florian_krause | OpenFOAM | 114 | August 23, 2023 06:37 |
How to use DESModelRegions function object | hakonbar | OpenFOAM Running, Solving & CFD | 33 | April 21, 2019 07:17 |
Problem with using function object to compute Nu number in parallel. | feldy77 | OpenFOAM Programming & Development | 0 | September 9, 2011 20:17 |
Problem with using function object to compute Nu number in parallel. | feldy77 | OpenFOAM Programming & Development | 0 | September 9, 2011 20:17 |
channelFoam for a 3D pipe | AlmostSurelyRob | OpenFOAM | 3 | June 24, 2011 14:06 |