CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

successful compilation of new function object BUT nothing is written in time folders

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 19, 2018, 01:42
Default successful compilation of new function object BUT nothing is written in time folders
  #1
Member
 
K
Join Date: Jul 2017
Posts: 97
Rep Power: 9
mkhm is on a distinguished road
Dear foamers,


I am trying to create a new post-processing tool. To do that, I followed this tutorial: http://www.tfd.chalmers.se/~hani/kur...CFD_Report.pdf . I can compile successfully but nothing is written in my time folders. I tried to copy one of the case in OpenFOAM-4.x/src/functionObjects/field/, give it another name, change the name in .C and .H file and mention this name in "file" located in OpenFOAM-4.x/src/functionObjects/field/Make/. No success. There is no compilation error and when I run rhoCentralFoam -postProcess -func newFunction as a command line, the necessary fields are read but nothing is written. To be more precise, when we execute for instance MachNo, we have :


Reading field U

Creating turbulence model

Selecting turbulence model type laminar
functionObjects::MachNo MachNo writing field: Ma


In my case withe newFunction, the line "functionObjects::MachNo MachNo writing field: Ma" (with Ma or MachNo = new names) is missing.



I tried also to include the following line in my controlDic:


functions
{
k
{
// Type of functionObject
type k;

// Where to load it from (if not already in solver)
libs ("libfieldFunctionObjects.so");

// Function object enabled flag
enabled true;

// When to output the average fields
writeControl writeTime;
}
}


But neither, nothing is written in my time folders.



I know that by modifying the solver, we can make it write the same variables that we write by executing postProcess commands, but I want to learn where in my procedure of creating new functionObjects, I am wrong.



I appreciate your help dear foamers,



regards
mkhm is offline   Reply With Quote

Old   August 22, 2018, 05:45
Default
  #2
Member
 
K
Join Date: Jul 2017
Posts: 97
Rep Power: 9
mkhm is on a distinguished road
No one could help me ?
mkhm is offline   Reply With Quote

Old   March 8, 2019, 02:35
Smile OpenFOAM Post-Processing
  #3
New Member
 
Ali Shahanaghi
Join Date: Nov 2016
Posts: 3
Rep Power: 10
Alishaha2 is on a distinguished road
you need to add following lines to your .C - main function

Foam::timeSelector::addOptions();
#include "addRegionOption.H"
#include "addDictOption.H"

#include "setRootCase.H"
#include "createTime.H"
Foam::instantList timeDirs = Foam::timeSelector::select0(runTime, args);
#include "createNamedMesh.H"

forAll(timeDirs, timeI)
{
runTime.setTime(timeDirs[timeI], timeI);

Foam::Info<< "Time = " << runTime.timeName() << Foam::endl;

mesh.readUpdate();

Foam::Yourfunction(args, runTime, mesh);

Foam::Info<< Foam::endl;
Alishaha2 is offline   Reply With Quote

Reply

Tags
functionobjects, openfoam, postprocess, utility


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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 18:22
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Community Contributions 58 December 23, 2021 03:36
pimpleDyMFoam computation randomly stops babapeti OpenFOAM Running, Solving & CFD 5 January 24, 2018 06:28
Running UDF with Supercomputer roi247 FLUENT 4 October 15, 2015 14:41
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 10:56


All times are GMT -4. The time now is 16:08.