read scalar field phi, get flux through faces
Hello,
I've a question. I write a program with the target to read the flux phi through some faces. (I need this for a special report. The code is already able to find the necessary faces. So the import of the mesh itself works.) But now I've no idea, how to read the flux phi through the faces, and especially everything I tried to source the field phi was not really successfully. Probably it's easy but I've no idea, how to do? Thanks a lot already for your help & best Regards, Peter <code> #include "argList.H" #include "cellSet.H" #include "topoSetSource.H" #include "Time.H" #include "globalMeshData.H" #include <fstream> //to write out the stl file #include <malloc.h> #include <string.h> using namespace Foam; using namespace std; // for input/output file // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Main program: int main(int argc, char *argv[]) { argList::noParallel(); #include "setRootCase.H" fileName sourceRootDir = "."; fileName sourceCaseDir = "."; Time runTime ( Time::controlDictName, sourceRootDir, sourceCaseDir ); #include "createPolyMesh.H" </code> |
Hi Peter,
can't you simply use: Code:
surfaceScalarField phi Code:
# include "createPhi.H" |
phi is already present in the time step (from data side), but
in the program there're no fields sourced at the moment. The point is that the class(?) surfaceScalarField is not known. Probably the right #include file is missing but here I've the problem if I take other programs like simpleFoam (or someome with phi present, that swallow... thing) I get a couple of more errors. Than the topo functions working no longer because at the end of the code I build a cellset. I need a method so that I can simple read the fields, especially the phi one, at that moment when I read the time step. Hope it's clear what I want. I'm not a real c++ expert, but my knowledge becomes better by day ;-) Thx & Best Regards, Peter |
Hi Peter,
is this a postprocessing routine or do you need to have the output in your solver? If it is a postprocessing routine you could try to have a look in the applications/utilities/postprocessing routines. Mayby you could use a foam::calc function or you could try to just add #include fvCFD.H Maybe this could work. Best Kathrin |
Hello,
thanks for your help. I began again with the simpleFoam.C and beginning from this code I tried to solve my problem. At the end it was in fact the simple point to add fvCFD but additionaly the order of the include files was important as well. Now it works. Thanks a lot and bye Peter |
Peter
Can you share your code. Here is my problem: in each pressure loop I need to find the fluxes through the faces lying in a particular cellZone and then multiply them with zero. And then pass this upadted velocity field to the next pressure loop. |
All times are GMT -4. The time now is 17:35. |