CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

BC which interpolate from an existing solution

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 5, 2013, 04:59
Default BC which interpolate from an existing solution
  #1
New Member
 
Marcel Vonlanthen
Join Date: Nov 2012
Location: Zurich, Switzerland
Posts: 27
Rep Power: 4
Sylv is on a distinguished road
Dear foamer,

I try to create a boundary condition which interpolate the volumic velocity field of an existing case (sourceCase) to the inlet patch of a running case (runCase).

To do this, I use the interpolate static method include in surfaceInterpolation.H.

Here is a piece of code included in the "updateCoeff" member function of my boundary:
Code:
fileName sourceRootDir = "path/to/source";
fileName sourceCaseDir = "sourceCase";
fileName sourceTime = "1000";

Time runTimeSource
    (
        Time::controlDictName,
        sourceRootDir,
        sourceCaseDir
    );
fvMesh meshSource
    (
        IOobject
        (
            sourceRegion,
            runTimeSource.timeName(),
            runTimeSource
        )
    );
volVectorField Usource
    (
        IOobject
        (
            "U",
            sourceTime, 
            meshSource,
            IOobject::MUST_READ,
            IOobject::NO_WRITE
        ),
        meshSource
    );

// do the interpolation
operator==(fvc::interpolate(Usource));
fixedValueFvPatchField<vector>::updateCoeffs();
The code compiles properly but during the solver run, I have the following message:
Code:
--> FOAM FATAL IO ERROR: 
keyword interpolate(U) is undefined in dictionary "/path/to/source/sourceCase/system/fvSchemes.interpolationSchemes"

file: /path/to/source/sourceCase/system/fvSchemes.interpolationSchemes

    From function dictionary::lookupEntry(const word&, bool, bool) const
    in file db/dictionary/dictionary.C at line 402.

FOAM exiting
This error appears even if the line "interpolate(U) linear" is included in fvSchemes like this:
Code:
interpolationSchemes
{
    interpolate(U)  linear;
}
Should I load fvSchemes with an IOobject? Is there a way to know if my boundary reads properly the fvSchemes file included in the source case?
Sylv is offline   Reply With Quote

Old   July 10, 2013, 06:06
Default
  #2
Senior Member
 
Anne Gerdes
Join Date: Aug 2010
Location: Hamburg
Posts: 152
Rep Power: 6
Anne Lincke is on a distinguished road
Dear Marcel,
I have the same problem, did you find a solution?

Kind Regards
Anne
Anne Lincke is offline   Reply With Quote

Old   July 11, 2013, 05:14
Default
  #3
New Member
 
Marcel Vonlanthen
Join Date: Nov 2012
Location: Zurich, Switzerland
Posts: 27
Rep Power: 4
Sylv is on a distinguished road
Quote:
Originally Posted by Anne Lincke View Post
Dear Marcel,
I have the same problem, did you find a solution?

Kind Regards
Anne
Hello Anne,

I fixed the error "interpolate(U)" by just adding one line in the IOobject of meshSource
Code:
fvMesh meshSource
    (
        IOobject
        (
            sourceRegion,
            runTimeSource.timeName(),
            runTimeSource,
            IOobject::MUST_READ  //this makes all the difference...
        )
    );
Now the solver runs, but the interpolation is still wrong. Lets assume my source simulation has 1000 cells and my target simulation 500 cells and 100 faces at inlet. When I run the target case with my new boundary condition, the target U file has 1000 values for the inlet, not 100! Somehow, there is no interpolation, just a transfer of the source cell values into the inlet face values of the target .

In the meantime, I used a different approach, but let me know if you have a working boundary!

Cheers,
Marcel
Sylv is offline   Reply With Quote

Reply

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
Asymmetrical solution using RANS Marli FLUENT 2 January 9, 2015 10:26
grid dependancy gueynard a. Main CFD Forum 19 June 27, 2014 21:22
Why 3D solid-pore geometry showing diverged solution? Sargam05 OpenFOAM 0 December 3, 2012 16:45
Analytic solution for 2D steady Euler equations jojo81 Main CFD Forum 0 October 15, 2012 12:05
Wall functions Abhijit Tilak Main CFD Forum 6 February 5, 1999 02:16


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