CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Initial Condition From Data File

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes
  • 1 Post By FlyBob91
  • 8 Post By FlyBob91

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   March 20, 2017, 06:09
Exclamation Initial Condition From Data File
  #1
Senior Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10
FlyBob91 is on a distinguished road
Hello to all,
I found this explanation to read data from file to set the initial condition

Code:
2.2.10 The #include and #inputMode directives
For example, let us say a user wishes to set an initial value of pressure once to be used as the internal field and initial value at a boundary. We could create a file, e.g. named initialConditions, which contains the following entries:

    pressure 1e+05; 
    #inputMode merge
In order to use this pressure for both the internal and initial boundary fields, the user would simply include the following macro substitutions in the pressure field file p:

    #include "initialConditions" 
    internalField uniform $pressure; 
    boundaryField 
    { 
        patch1 
        { 
            type fixedValue; 
            value $internalField; 
        } 
    }
This is a fairly trivial example that simply demonstrates how this functionality works. However, the functionality can be used in many, more powerful ways particularly as a means of generalising case data to suit the user’s needs. For example, if a user has a set of cases that require the same RAS turbulence model settings, a single file can be created with those settings which is simply included in the turbulenceProperties file of each case. Macro substitutions can extend well beyond a single value so that, for example, sets of boundary conditions can be predefined and called by a single macro. The extent to which such functionality can be used is almost endless.
How can i modify these code to read a nonuniform vecotr field at my boundary? I want to set a non uniform field for the velocity boundary condition



Thanks for help
ships26 likes this.
FlyBob91 is offline   Reply With Quote

 


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
chtMultiRegionSimpleFoam: maximum number of iterations excedeed. Nkl OpenFOAM Running, Solving & CFD 19 October 10, 2019 02:42
Cannot run the code properly: very large time step continuity error crst15 OpenFOAM Running, Solving & CFD 9 December 14, 2014 18:17
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 01:41
calculation stops after few time steps sivakumar OpenFOAM Running, Solving & CFD 7 March 17, 2013 06:37
pisoFoam with k-epsilon turb blows up - Some questions Heroic OpenFOAM Running, Solving & CFD 26 December 17, 2012 03:34


All times are GMT -4. The time now is 05:02.