CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Using fieldAverage function in parallel (https://www.cfd-online.com/Forums/openfoam-solving/224992-using-fieldaverage-function-parallel.html)

Cal March 10, 2020 21:02

Using fieldAverage function in parallel
 
Hi all,

I am currently running a case analyzing spray in a tube using the sprayFoam solver. I am running it remotely on multiple processes via the mpirun command. The code I am using to run the solver is:


mpirun -np 16 sprayFoam -parallel > log 2>&1


This has worked perfectly until I wanted to use the fieldaverage function. I receive an error message stating that the fieldAverage function was unable to locate a file path. error message:

Code:

[1] --> FOAM FATAL ERROR:
[1] cannot find file "/scratch/RDS-FSC-gbr-RW/Accuracy_Tests/AT_003/Master/processor1/0/s"
[1]
[1] [7] [10]    From function virtual Foam::autoPtr<Foam::ISstream> Foam::fileOperations::uncollatedFileOpera$
[1]    in file global/fileOperations/uncollatedFileOperation/uncollatedFileOperation.C at line 505.
[1]
FOAM parallel run exiting

My controlDict file is:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  5                                    |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application    sprayFoam;

startFrom      latestTime;

startTime      0;

stopAt          endTime;

endTime        3.5e-3;//0.32;

deltaT          1e-8;

writeControl    adjustableRunTime;

writeInterval  1e-5;

purgeWrite      20;

writeFormat    ascii;

writePrecision  6;

writeCompression uncompressed;

timeFormat      general;

timePrecision  6;

adjustTimeStep  yes;

maxCo          0.038;

runTimeModifiable yes;

functions
{

    #includeFunc  residuals
 
    probes
    {
        type            probes;
        libs            ("libsampling.so");
        writeControl    timeStep;
        writeInterval  1;

        fields
        (
            p U
        );

        probeLocations
        (
            (0.05 0.115 0)
            (0.05 0.06 0)
            (0.05 0.01 0)
        );

    }

    fieldAverage1
    {
        type            fieldAverage;
        libs            ("libfieldFunctionObjects.so");
        writeControl    writeTime;

        fields
        (
            U
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }

            p
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }
        );
    }

    #includeFunc scalarTransport
}



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

I don't want to post process the fieldaverage as the solution is very large and I don't want to have to collect the entire run's worth of data. What do I need to do to be able to run this case in parallel?

Thanks!! and let me know if you need anymore info

Yann March 11, 2020 03:25

Hello Calvin,

Are you sure the error is related to the fieldAverage function?

Your error message complains about a missing file named "s" and this is usually the default name of the variable used in scalar transport, which is the function you are using right after fieldAverage in your controlDict.

Was the scalarTransport function working before you added the fieldAverage function?

Yann

Cal March 11, 2020 03:56

omg Yann you're totally right! I have over looked that for sooooo long


It is resolved :) Thankyou!


All times are GMT -4. The time now is 19:32.