CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [waves2Foam] IO error when running waveIsoFoam with OF1812: Dictionary entry not found (https://www.cfd-online.com/Forums/openfoam-community-contributions/225271-io-error-when-running-waveisofoam-of1812-dictionary-entry-not-found.html)

JinshiC March 20, 2020 21:10

IO error when running waveIsoFoam with OF1812: Dictionary entry not found
 
Hi all,

I am currently trying to run waveIsoFoam, one of the new solver from waves2Foam, with OF1812. However, when I tested a case that I have successfully run with waveFoam on OF1712, I got the following error message:
Code:

[31] --> FOAM FATAL IO ERROR:
[31] Dictionary entry for patch inlet not found
[31]
[31] file: IOstream
[31]
[31]    From function static Foam::autoPtr<Foam::waveModel> Foam::waveModel::New(const Foam::word&, const Foam::fvMesh&, const Foam::polyPatch&)
[31]    in file waveModel/waveModelNew.C at line 58.

Some times it would include a path in the error
Code:

[0] --> FOAM FATAL IO ERROR:
[0] Dictionary entry for patch inlet not found
[0]
[0] file: /vortexfs1/scratch/jinshichen/waveFlume_rand_kostab_topo_parallel_iso_run/processor0/constant/waveProperties
[0]
[0]    From function static Foam::autoPtr<Foam::waveModel> Foam::waveModel::New(const Foam::word&, const Foam::fvMesh&, const Foam::polyPatch&)
[0]    in file waveModel/waveModelNew.C at line 58.

However, I do include the inlet properties in the waveProperties file, which is shown below:

Code:

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

seaLevel            4.5;
seaLevelAsReference true;

relaxationNames    ( inlet outlet );

initializationName  outlet;

inletCoeffs
{
    waveType            irregular;
    N                  50;      //Number of sampling frequencies
    Tsoft              30;        //Ramp time

    // Define the phases
    phaseMethod        randomPhase;

    // Define the spectrum
    spectrum            JONSWAP;
    Hs                  0.8;      // Significant wave height
    Tp                  7;        // Peak wave period 
    gamma              3.3;      // Peak enhancement factor
    depth              4.5;      // Water depth
    direction          (1 0 0);
   
    frequencyAxis
    {
      discretisation      equidistantFrequencyAxis;

      lowerFrequencyCutoff 0.1;
      upperFrequencyCutoff 0.3;

      writeSpectrum        false;
    }

    relaxationZone
    {
        relaxationScheme    Spatial;
        relaxationShape    Rectangular;
        beachType          Empty;
        relaxType          INLET;
        startX              ( 0 0 0 );
        endX                ( 30 1 0 );
        orientation        ( 1 0 0 );
    }
}

outletCoeffs
{
    waveType            potentialCurrent;
    U                  ( 0 0 0 );
    Tsoft              2;

    relaxationZone
    {
        relaxationScheme    Spatial;
        relaxationShape    Rectangular;
        beachType          Empty;
        relaxType          OUTLET;
        startX              ( 350.907 0 0 );
        endX                ( 370.907 1 0 );
        orientation        ( 1 0 0 );
    }
}



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

Thus, I am wondering what is wrong with this code. Since I have successfully run the identical case with wavefoam solver on OF1712, I am wondering that whether there are some required syntax change when converting this to waveIsoFoam and OF1812? (I have changed the setting for isosurface part in the fvSolution, but I didn't change the rest).

My controlDict looks like the following:

Code:

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

application    interFoam;

startFrom      startTime;

startTime      0;

stopAt          endTime;

endTime        10;

deltaT          0.001;

writeControl    adjustableRunTime;

writeInterval  0.05;

purgeWrite      6;

writeFormat    ascii;

writePrecision  6;

writeCompression uncompressed;

timeFormat      general;

timePrecision  6;

runTimeModifiable yes;

adjustTimeStep  yes;

maxCo          0.05;

maxAlphaCo      0.25;

maxDeltaT      1;



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

Thank you in advance for all of your input on this!

JinshiC March 22, 2020 15:17

Hi all,

I have found a temporary fix: If you delete the "waveModel" library from EXE_LIB list in file "/waves2Foam/applications/solvers/solvers1812_PLUS/waveIsoFoam/Make/options" and recompile it, it should fix the problem. However I am still looking for a more thorough solution.

Thank you!

Best,
Jinshi

ngj March 23, 2020 11:25

Hi Jinshi,

Thank you for reporting the bug. I have removed waveModels in Make/options and updated the repository. It is indeed a bug, because waveModels relate to the OpenFoam-ESI wave models and not waves2Foam.

Kind regards

Niels

fsifsi January 4, 2021 10:08

‘g’ was not declared in this scope
 
Quote:

Originally Posted by JinshiC (Post 762489)
Hi all,

I have found a temporary fix: If you delete the "waveModel" library from EXE_LIB list in file "/waves2Foam/applications/solvers/solvers1812_PLUS/waveIsoFoam/Make/options" and recompile it, it should fix the problem. However I am still looking for a more thorough solution.

Thank you!

Best,
Jinshi

Hello Jinshi
I try to combine interfoam and wavefoam in OF1812, but i got error when i wmake for new solver as:
/home/leqt/OpenFOAM/leqt-v1812/applications/utilities/waves2Foam/src/waves2Foam/lnInclude/readWaveProperties.H:27:38: error: ‘g’ was not declared in this scope
referencePoint.value() = g.value()/Foam::mag(g.value());
^

Could you tell me how to fix it, please.
Many thanks

JinshiC January 4, 2021 13:45

Hi Le,

I am not entirely sure what you did, and I didn't make a new solver my own (just using Niels' waveIsoFoam solver). However, it does seem to me that you have missed defining g (gravitational acceleration) somewhere in your model but have included it in the back end equation. I'd personally like to refer your question to other people who are more experienced that me.

Thank you!

Best,
Jinshi

Rasmusiwersen May 12, 2021 03:33

Quote:

Originally Posted by JinshiC (Post 762489)
Hi all,

I have found a temporary fix: If you delete the "waveModel" library from EXE_LIB list in file "/waves2Foam/applications/solvers/solvers1812_PLUS/waveIsoFoam/Make/options" and recompile it, it should fix the problem. However I am still looking for a more thorough solution.

Thank you!

Best,
Jinshi

Perhaps a silly question.. But can you elaborate on how to peform the recompilation? I don't really know where to start...

FVP January 4, 2022 07:10

Hello everyone, I am using the OF2012 and I am facing the same problem as you. Do you know if the solution is the same as what you did for your OF version?
Did anyone face this problem with the OF2012?

Thank you in advance.

MFS September 5, 2023 11:51

Quote:

Originally Posted by ngj (Post 762578)
Hi Jinshi,

Thank you for reporting the bug. I have removed waveModels in Make/options and updated the repository. It is indeed a bug, because waveModels relate to the OpenFoam-ESI wave models and not waves2Foam.

Kind regards

Niels

Hi Niels,


First of all I would like to thank you for you great work with waves2Foam.



I guess you were talking about /solvers1812_PLUS/. I have realized that in the next version solvers (2012, 2106 and 2206) the "wave model" library is still in the options file. I was having the same error " Dictionary entry for patch inlet not found". Once I recompile without it, there is no error.


It is still a bug or am I missing something?


Kind regards,


Manuel

zhnf September 10, 2023 17:39

Quote:

Originally Posted by MFS (Post 856387)
Hi Niels,


First of all I would like to thank you for you great work with waves2Foam.



I guess you were talking about /solvers1812_PLUS/. I have realized that in the next version solvers (2012, 2106 and 2206) the "wave model" library is still in the options file. I was having the same error " Dictionary entry for patch inlet not found". Once I recompile without it, there is no error.


It is still a bug or am I missing something?


Kind regards,


Manuel

Hi Seoane,

Could you elaborate the recompile process after you deleted the wavemodel library please? Thank you.

MFS September 11, 2023 06:23

Hi Zhang,


Once I deleted the file, I just executed "wmake" command in ~/waves2Foam/applications/solvers/solvers2206_PLUS/my_new_solver/


I followed the instructions given in the waves2Foam manual.


I don't know if I have already solve your doubt...


Kind regards,


Manuel


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