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

initial conditions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 25, 2009, 10:50
Default initial conditions
  #1
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
Hi,

Inside the /0 directory I have the initialConditions file with
--------------------------
sideslip 20;
velocityMagnitude 20;
pressure 0;
turbulentKE 0.24;
turbulentOmega 1.78;
#inputMode merge
--------------------------

I have the U file with :
--------------------------
#include "initialConditions"

dimensions [0 1 -1 0 0 0 0];

internalField uniform ($velocityMagnitude*cos(sideslip) $velocityMagnitude*sin(sideslip) 0);

--------------------------

The last line (internalField uniform ...) is not valid.

Is it possible to write such an expression there ?

Regards,

Stephane
openfoam_user is offline   Reply With Quote

Old   November 26, 2009, 02:25
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,685
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by openfoam_user View Post
I have the U file with :
--------------------------
#include "initialConditions"

dimensions [0 1 -1 0 0 0 0];

internalField uniform ($velocityMagnitude*cos(sideslip) $velocityMagnitude*sin(sideslip) 0);
--------------------------

The last line (internalField uniform ...) is not valid.

Is it possible to write such an expression there ?
No, what you are trying isn't possible. The code would need an extra interpreter in the dictionary processing for that to work.
If you don't mind having two passes, you could write an "initialConditions.m4" and pass it through the m4 processor first to produce your "initialConditions" file.
If you look through the tutorials, you can see a few examples where m4+perl has been used to create blockMeshDict files.

Here's a quick way to find those examples:
Code:
git ls-files | grep .m4
olesen is offline   Reply With Quote

Reply


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
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 15:33
Computational time sunnysun OpenFOAM Running, Solving & CFD 5 March 16, 2009 03:32
Differences between serial and parallel runs carsten OpenFOAM Bugs 11 September 12, 2008 11:16
Unknown error sivakumar OpenFOAM Pre-Processing 9 September 9, 2008 12:53


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