CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

timeVaryingMappedFixedValue not working without headers!

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 12, 2018, 11:38
Smile timeVaryingMappedFixedValue not working without headers!
  #1
New Member
 
Peter Ladefoged
Join Date: Jun 2018
Posts: 2
Rep Power: 0
PeterL89 is on a distinguished road
Dear all foamers,


I am trying to surface sample the seabed pressure beneath regular progressive waves and imposing this pressure data to a new domain where a constitutive soil model is solving Biots equations for pore pressure development.

I use the surface sampling utility to map the seabed pressures in the wave model as such:

Code:
functions
{
    surfaces1
    {
        type                    surfaces;
        functionObjectLibs              ("libsampling.so");
        writeControl            adjustableRunTime;
        writeInterval           1;
    enabled             true;
        surfaceFormat           boundaryData;
        fields
        (
               p_rgh
           p
        );
        interpolationScheme cellPointFace;
        surfaces
        (
            inlet
            {
                type        patch;
                patches     (bottom);
                triangulate false;
            }
        );
    }
}
And that seems to be working fine. I copy my files to my soil folder into /constant/boundaryData/top/... When I try to run OpenFOAM complains that no header is given in the boundaryData files:

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM Extend Project: Open source CFD        |
|  \\    /   O peration     | Version:  1.6-ext                               |
|   \\  /    A nd           | Web:      www.extend-project.de                 |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 1.6-ext-f3027b3161e4
Exec   : twoSurfacePlastBiotFoam
Date   : Oct 12 2018
Time   : 17:35:49
Host   : n-62-27-21
PID    : 1191
Case   : /work3/s123098/soil_waveFlume_test_2
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading soil properties

Reading pore pressure field

--> FOAM Serious Error : 
    From function IOobject::readHeader(Istream&)
    in file db/IOobject/IOobjectReadHeader.C at line 90
    Reading "/work3/s123098/soil_waveFlume_test_2/constant/boundaryData/top/0/p" at line 2
    First token could not be read or is not the keyword 'FoamFile'

Check header is of the form:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM Extend Project: Open source CFD        |
|  \\    /   O peration     | Version:  1.6-ext                               |
|   \\  /    A nd           | Web:      www.extend-project.de                 |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       scalarAverageField;
    location    "constant/boundaryData/top/0";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //



--> FOAM FATAL IO ERROR: 
problem while reading header for object p

file: /work3/s123098/soil_waveFlume_test_2/constant/boundaryData/top/0/p at line 2.

    From function regIOobject::readStream()
    in file db/regIOobject/regIOobjectRead.C at line 70.

FOAM exiting
Now I am using OpenFOAM v1712 with waves2foam for the generating waves, while using OpenFOAM-1.6-ext for the soil model (as it was developed for this), but untill now I haven't had any problems with compatibility.

Anybody has any idea how to generate output files from surface sampling with appropriate headers, without having to do this manually or set up a script?

Best Regards
Peter

Last edited by wyldckat; October 14, 2018 at 08:35. Reason: Added [CODE][/CODE] markers
PeterL89 is offline   Reply With Quote

Old   October 14, 2018, 08:42
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,381
Blog Entries: 41
Rep Power: 114
wyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of lightwyldckat is a glorious beacon of light
Quick answer: I haven't checked, but perhaps this is already fixed in foam-extend 4.0, so if perhaps the code you have in 1.6-ext were to build with foam-extend 4.0, it may solve this issue.


If not, then a possible workaround is that you rely on file inclusion instead:
  1. Rename the file you have with the actual data, e.g.:
    Code:
    mv constant/boundaryData/top/0/p constant/boundaryData/top/0/p.data
  2. Then create the file that will act as the wrapper, for example, place the following inside a new file "constant/boundaryData/top/0/p":
    Code:
    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM Extend Project: Open Source CFD        |
    |  \\    /   O peration     | Version:  1.6-ext                               |
    |   \\  /    A nd           | Web:      www.extend-project.de                 |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
        version     2.0;
        format      ascii;
        class       scalarAverageField;
        object      values;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    #include "p.data"
  3. The header is generic enough, and the last line will include the complete content of the original file that is now named "p.data". Therefore, you can copy-paste-adapt this file "p" for any other files, such as "p_rgh", but don't forget to first rename the data files first.
__________________
wyldckat is offline   Reply With Quote

Reply

Tags
coupling 2 solvers, headers, surface sampling, timevaryingmappedfixedval

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
findCell() in parallel: not working if location is outside the domain TobiWol OpenFOAM 0 January 10, 2018 14:33
Processor 0 not working vishwesh OpenFOAM Running, Solving & CFD 0 November 17, 2017 03:35
corrupt headers in sampled data output KTG OpenFOAM Post-Processing 1 July 29, 2017 17:01
DPM parallel is not working but serial is working johnwinter FLUENT 1 March 27, 2012 02:01
Working directory mgonzalo FLUENT 1 November 11, 2011 10:05


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