CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Problem tool: Snip calculating mass flow (https://www.cfd-online.com/Forums/openfoam-programming-development/123991-problem-tool-snip-calculating-mass-flow.html)

Kenna September 25, 2013 09:47

Problem tool: Snip calculating mass flow
 
Hi everyone,

I found a tool called "Snip calculating mass flow" for calculating the mass flow through patches for every time step.
It is explained here:
http://openfoamwiki.net/index.php/Sn...ting_mass_flow
Originally from here:
http://www.cfd-online.com/Forums/openfoam-solving/58109-calculation-integral-boundary-values.html

I use OpenFOAM 2.2.0 and wanted to add this tool in my custom compressibleTwoPhaseEulerFoam-Solver.

I tried to follow the step explained in the first link, but I might interpreted some instructions wrong:

- I created the calculatee massFlux.H and the buildGlobalBoundaryList.H (from the first Link) in the main folder of the solver. - Next to createFields.H etc.

- I included those files in the compressibleTwoPhaseEulerFoam.C like this:
Code:

#include "fvCFD.H"
#include "MULES.H"
#include "subCycle.H"
#include "rhoThermo.H"
#include "nearWallDist.H"
#include "wallFvPatch.H"
#include "fixedValueFvsPatchFields.H"
#include "Switch.H"

#include "SortableList.H" //mass flow calculation

#include "IFstream.H"
#include "OFstream.H"

#include "phaseModel.H"
#include "dragModel.H"
#include "heatTransferModel.H"
#include "kineticTheoryModel.H"

#include "pimpleControl.H"

#include "IOMRFZoneList.H"



// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{
    #include "setRootCase.H"

    #include "createTime.H"
    #include "createMesh.H"

    #include "readGravitationalAcceleration.H"
    #include "createFields.H"

    #include "createMRFZones.H"
    #include "readPPProperties.H"
    #include "initContinuityErrs.H"
    #include "readTimeControls.H"
    #include "CourantNos.H"
    #include "setInitialDeltaT.H"

    #include "buildGlobalBoundaryList.H" //mass flow calculation


    pimpleControl pimple(mesh);

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    Info<< "\nStarting time loop\n" << endl;

- At the end of the same file put this:
Code:

        #include "write.H"
    #include "computeMassFlux.H" //mass flow calculation
.

        Info<< "ExecutionTime = "
            << runTime.elapsedCpuTime()
            << " s\n\n" << endl;

If I try "wmake" or "./Allwmake" in the console it says:
Code:

my3_compressibleTwoPhaseEulerFoam.C:77:65: schwerwiegender Fehler: buildGlobalBoundaryList.H: Datei oder Verzeichnis nicht gefunden
Kompilierung beendet.

or translated:
Code:

my3_compressibleTwoPhaseEulerFoam.C:77:65: critical Error: buildGlobalBoundaryList.H: Data or file not found.
stopped compiling.

I don't understand where computeMassFlux.H should even exist.

I tried quite a while to understand it but I am making no progress. I would apprciate your help.
Sincerely Kenna


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