|
[Sponsors] |
March 20, 2017, 06:09 |
Initial Condition From Data File
|
#1 |
Senior Member
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10 |
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. Thanks for help |
|
|
|
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 |