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

initial conditions

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 25, 2009, 11:50
Default initial conditions
  #1
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 300
Rep Power: 9
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, 03:25
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
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

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
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 04: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 13:32.