request to add more functions to cfdof

A subforum specific to the development of the OpenFoam-based workbenches ( Cfd https://github.com/qingfengxia/Cfd and CfdOF https://github.com/jaheyns/CfdOF )

Moderator: oliveroxtoby

Post Reply
M4mina
Posts: 8
Joined: Sat Apr 09, 2022 4:48 am

request to add more functions to cfdof

Post by M4mina »

I am a hydraulic engineer, I use cfdof in parallel to other commercial software, I want to thank you Oliver for the progress you are achieving and for your efforts
during my work I had to insert some functions to make it work, it should be the same way cfdof inserts the force function. I insert the wall shear stress, mass flowrate for multiphase flow, also I edit the wall roughness and surface tension in the dictionaries,
I would like to ask if there is a way to generate those functions form cfdof directly, kindly find the example below:

Code: Select all

functions 

{
   inlet1
   {
        type            surfaceFieldValue;
        libs ("libfieldFunctionObjects.so");
        enabled         true;
        writeControl    timeStep;
        writeInterval   1;
        log             true;
        writeFields     false;
        regionType      patch;
        name            inlet;
        operation       sum; //absWeightedSum; //sum; //weightedAreaAverage;
        //weightField     alpha.Water;
        fields
        (
            rhoPhi
        );
   }
   PST1
   {
        type            surfaceFieldValue;
        libs ("libfieldFunctionObjects.so");
        enabled         true;
        writeControl    timeStep;
        writeInterval   1;
        log             true;
        writeFields     false;
        regionType      patch;
        name            open001;
        operation       sum; 
        //weightField     alpha.Water;
        fields
        (
            rhoPhi
        );
   }
   PST2
   {
        type            surfaceFieldValue;
        libs ("libfieldFunctionObjects.so");
        enabled         true;
        writeControl    timeStep;
        writeInterval   1;
        log             true;
        writeFields     false;
        regionType      patch;
        name            open002;
        operation       sum;
        fields
        (
            rhoPhi
        );
   }    
   PST3
   {
        type            surfaceFieldValue;
        libs ("libfieldFunctionObjects.so");
        enabled         true;
        writeControl    timeStep;
        writeInterval   1;
        log             true;
        writeFields     false;
        regionType      patch;
        name            open003;
        operation       sum;
        fields
        (
            rhoPhi
        );
   }
   PST4
   {
        type            surfaceFieldValue;
        libs ("libfieldFunctionObjects.so");
        enabled         true;
        writeControl    timeStep;
        writeInterval   1;
        log             true;
        writeFields     false;
        regionType      patch;
        name            open004;
        operation       sum;
        fields
        (
            rhoPhi
        );
   }
//forces
    ReportingFunction
    {
        type                forces;
        libs                ("libforces.so");
        log                 true;

        patches             ( bridgeinvert );
        p_rgh               p_rgh;
        U                   U;
        rho                 rho;
        pRef                0.0;
        porosity            false;
        writeFields         false;
        CofR                ( 0.0 0.0 0.0 );

        binData
        {
            nBin            20;
            direction       ( 1.0 0.0 0.0 );
            cumulative      true;
        }
    }
//shearstress    
    wallShearStress1
    {
    // Mandatory entries (unmodifiable)
    type            wallShearStress;
    libs            (fieldFunctionObjects);

    //runtime modifiable
    patches         (defaultFaces); // (wall1 "(wall2|wall3)");

    // Optional (inherited) entries
    writePrecision  8;
    writeToFile     true;
    useUserTime     true;
    //region          region0;
    enabled         true;
    //log             true;
    //timeStart       0;
    //timeEnd         300;
    executeControl  adjustableRunTime;
    executeInterval 1;
    writeControl    adjustableRunTime;
    writeInterval   25;
    }  

}

// ************************************************************************* //
If it is possible, I would be grateful. We can generate some tutorials incorporating them for water treatment plants and pump station work which I do usually.
Last edited by M4mina on Sat Oct 15, 2022 11:09 am, edited 1 time in total.
chrisb
Veteran
Posts: 54168
Joined: Tue Mar 17, 2015 9:14 am

Re: request to add more functions to cfdof

Post by chrisb »

Please put the code in code tags (button </>) for improved readability.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply