CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Specifying nonuniform initial condition (https://www.cfd-online.com/Forums/openfoam-solving/58077-specifying-nonuniform-initial-condition.html)

msyaml March 25, 2005 11:05

Hi, I have a 2D domain consis
 
Hi,
I have a 2D domain consisting of four blocks. I want to specify the initial condition for a field variable as T=1 in block 0 and as T=0 in the other three blocks. Is there a way to specify the initial condition block-by-block? i.e., in file T in folder 0 use the keyword non-uniform and specify a list of blocks and the corresponding T values. I am a novice user and was not able find an example for this in the user's or programmer's guide or in tutorial cases (e.g., damBreak example is similar but seems to use an initialization program). Thanks.
Syam

mattijs March 25, 2005 11:34

The concept of blocks only exi
 
The concept of blocks only exists in blockMesh. (assuming that you are using blockMesh) After mesh generation (with whichever mesh generator you use) OpenFOAM has no concept of blocks. The whole mesh is one unstructured set of cells of arbitrary shape.

Since there is no information kept on what cells originate from what block you'll have to select them yourself. The damBreak application comes closest to your needs I think.

Mattijs

sampaio March 25, 2005 12:04

What if you build another case
 
What if you build another case, with only one block, coinciding with the one you want T=1. Than, if you use mapFields from there to your actual case....
Would that work for you?
I know, it is a little dirty solution...
Luiz

msyaml March 25, 2005 15:16

Luiz, Thanks for that clever
 
Luiz,
Thanks for that clever solution! Although an additional case was needed, your solution reduced the complexity of the original case (fewer blocks) and eliminated the need for an initialization program.
Syam

maka November 15, 2005 14:06

I'm trying to set a turbulent
 
I'm trying to set a turbulent nonuniform initial condition for a channel flow case. The field is available in a file with the format (column-wise):

x y z u v w p

1) I found that SetField utility that is used in the dam break case (1.2) is designed to do similar job but it uses dictionary as its input. Can any body explain how to use or modify the utility to use a data file as input.

2) I also thought of using mapField utility after trying to make a new case and cast my data into the OpenFOAM format but I faced the following problem:

the file constant/polyMesh/"points" describes vertices while what is available at my case is the node values that correspond to the values of 0/U and 0/p. I would be grateful if some body can give some help about how to solve this problem.


3) one final question about constant/polyMesh/cells: does the file format of openFOAM enforces any rules regarding the order of cells in the file or it is fully unstructured and I can order the cells as I like as long as it is consistent with 0/U, and 0/p format.

Thanks.
best regards,
Maka

maka November 15, 2005 14:40

I noticed a talk about cellSet
 
I noticed a talk about cellSet in:
http://www.cfd-online.com/OpenFOAM_D...tml?1131637441
http://www.cfd-online.com/OpenFOAM_D...es/1/1240.html

Can any one explain or give example of how to use cellSet to solve this problem or even what is cellSet? sorry I'm a beginner. Thanks.

Regards,
Maka

mattijs November 16, 2005 04:28

Look at e.g. interFoam/system/
 
Look at e.g. interFoam/system/setFieldsDict.

It uses the 'boxToCell' source. Instead you can use say the 'cellToCell' source which allows you to use a cellSet. (b.t.w. these sources are exactly the same one cellSet uses)

Mistype it and run setFields to see all the possible sources.

vvqf November 16, 2005 10:36

in boxToCell, we have def
 
in boxToCell, we have
defaultFieldValues
(
volScalarFieldValue alpha 1
);

regions
(
boxToCell
{
box (0.4 0 0) (1 1 0.1);

fieldValues
(
volScalarFieldValue alpha 0.1
);
}

What about cellToCell, how to write this?
I looked into the source codes cellToCell.H/C, but didn't find answer.

mattijs November 17, 2005 05:05

to e.g. read cellSet c0 replac
 
to e.g. read cellSet c0 replace the

boxToCell
{
box (..)(..)

fieldValues ...
}

with:


cellToCell
{
set "c0";

fieldValues ...
}


(or maybe lose the quotes around c0)
Also look at the sample cellSetDict in the cellSet utility.

nico January 4, 2006 06:39

Hi Mattijis How to read in
 
Hi Mattijis

How to read in a file containig a list of cells, for example /constant/polyMesh/sets/fluid.1 ?


The file looks like:

/*---------------------------------------------------------------------------*
FoamFile
{
version 2.0;
format ascii;

root "OpenFOAM/nico-1.2/run/tutorials/simpleFoam";
case "test01";
instance ""constant"";
local "polyMesh/sets";

class cellSet;
object fluid.4;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


240
(
50
51
52
53
.
.
279
280
)

/*************************************************/

Thanks and a happy new year

gschaider January 13, 2006 04:04

As an example for reading a ce
 
As an example for reading a cellSet and manipulating data in these cells you can use this:

http://openfoamwiki.net/index.php/Contrib_setfiel dbycellset

melanie March 20, 2006 11:29

Hello, I would like to spec
 
Hello,

I would like to specify non uniform initial conditions for my case, with respect to the coordinates of the nodes.
Exemple: the velocity field is defined such as
r = x^2 + y^2
U[x] = y * a/ r^2
U[y] = -x * b/ r^2

How would you write it ? Firstly, I don't know how to access to the nodes coordinates which is blocking me...

Thanks.

mattijs March 21, 2006 04:09

Look at the setGammaDambreak a
 
Look at the setGammaDambreak app from OpenFOAM1.1. Or look on this site for setGammaField. It should contain how to access coordinates.

melanie March 21, 2006 04:54

Mattijs, I looked at the DamB
 
Mattijs,
I looked at the DamBreak case, but the velocity field is set thanks to a bounding box, so this is a different case.
Here I report what I have already written, with the error message at compilation:

#include "fvCFD.H"
#include "physicalConstants.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{

# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "createFields.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

scalar pi = physicalConstant::pi;
scalar r_0 = 0.0036;
scalar r_c = r_0*2.0/9.0;
scalar gamma = 4.0 * pi * r_c * 340.0 / 2.0;


forAll(mesh.C(), celli)
{
scalar x = mesh.C()[celli].x;
scalar y = mesh.C()[celli].y;

scalar r_1 = ::pow((x+r_0)*(x+r_0) + y*y ,0.5);
scalar r_2 = ::pow((x-r_0)*(x-r_0) + y*y ,0.5);

scalar V_theta1 = - gamma * r_1/(2.*pi*(r_c*r_c + r_1*r_1));
scalar V_theta2 = - gamma * r_2/(2.*pi*(r_c*r_c + r_2*r_2));

scalar Ux = -y * (V_theta1/r_1 + V_theta2/r_2);
scalar Uy = (x-r_0) * V_theta1/r_1 + (x+r_0) * V_theta2/r_2;
scalar Uz = 0.0;

U[celli] = (Ux Uy Uz);

}

U.write();

Info << "\n end\n";

return(0);
}

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

tzntgq@cfdlem04:~/OpenFOAM/OpenFOAM-1.2.1/applications/utilities/preProcessing/corotVortex> wmake
Making dependency list for source file corotVortex.C

SOURCE_DIR=.
SOURCE=corotVortex.C ; g++ -m64 -DlinuxAMD64 -Wall -W -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -ffast-math -DNoRepository -ftemplate-depth-30 -Wno-deprecated -I/home/tzntgq/OpenFOAM/OpenFOAM-1.2.1/src/cfdTools/compressible -I/home/tzntgq/OpenFOAM/OpenFOAM-1.2.1/src/cfdTools/general/lnInclude -I/home/tzntgq/OpenFOAM/OpenFOAM-1.2.1/src/OpenFOAM/lnInclude -IlnInclude -I. -fPIC -c $SOURCE -o Make/linuxAMD64Gcc4Opt/corotVortex.o
corotVortex.C: In function 'int main(int, char**)':
corotVortex.C:57: error: cannot resolve overloaded function 'x' based on conversion to type 'Foam::scalar'
corotVortex.C:58: error: cannot resolve overloaded function 'y' based on conversion to type 'Foam::scalar'
corotVortex.C:70: error: expected `)' before 'Uy'
corotVortex.C:70: error: no match for 'operator=' in 'U.Foam::GeometricField<foam::vector,>::<anonymous >.Foam::Field<foam::vector>::< anonymous>.Foam::List<foam::vector<foam::scalar> >::<anonymous>.Foam::UList<t>::operator[] [with T = Foam::vector](celli) = Ux'
/home/tzntgq/OpenFOAM/OpenFOAM-1.2.1/src/OpenFOAM/lnInclude/Vector.H:62: note: candidates are: Foam::Vector<foam::scalar>& Foam::Vector<foam::scalar>::operator=(const Foam::Vector<foam::scalar>&)
corotVortex.C:67: warning: unused variable 'Uy'
corotVortex.C:68: warning: unused variable 'Uz'
make: *** [Make/linuxAMD64Gcc4Opt/corotVortex.o] Error 1

At compilation, x and y are not recognized and the vector field U is not understood...
Could anyone give me a hint please ?

pierre March 21, 2006 07:35

maybe try forAll(mesh.cells(
 
maybe try
forAll(mesh.cells(), cellsI)
scalar x = mesh.C()[cellI].component(0)
rather than forAll(mesh.C(), celli)...

Pierre

melanie March 21, 2006 08:26

Thank you Pierre, it worked fo
 
Thank you Pierre, it worked for x and y with actually
forAll(mesh.cells(),cellI)
scalar x = mesh.C()[cellI].component(0).

Now I still have a problem with the velocity; I have defined Ux, Uy and Uz, and the line
U[cellI] = (Ux, Uy, Uz);
gives me the error message

corotVortex.C:71: warning: left-hand operand of comma has no effect
corotVortex.C:71: warning: right-hand operand of comma has no effect
corotVortex.C:71: error: no match for 'operator=' in 'U.Foam::GeometricField<foam::vector,>::<anonymous >.Foam::Field<foam::vector>::< anonymous>.Foam::List<foam::vector<foam::scalar> >::<anonymous>.Foam::UList<t>::operator[] [with T = Foam::vector](cellI) = (((void)Ux, (void)Uy), Uz)'
/home/tzntgq/OpenFOAM/OpenFOAM-1.2.1/src/OpenFOAM/lnInclude/Vector.H:62: note: candidates are: Foam::Vector<foam::scalar>& Foam::Vector<foam::scalar>::operator=(const Foam::Vector<foam::scalar>&)

pierre March 21, 2006 08:55

try U = vector(Ux, Uy, Uz);
 
try
U[cellI] = vector(Ux, Uy, Uz);

Pierre

melanie March 21, 2006 09:54

thank you Pierre, now everythi
 
thank you Pierre, now everything is working well !
mélanie

gschaider March 26, 2006 17:21

Inspired by this thread (and b
 
Inspired by this thread (and because I wanted such a thing for myself for some time) I decided to visit two friends of the time of my diploma thesis (the compiler generators bison and flex) and write a utility that can set fields using complex expressions (from the command line or with a dictionary). A first version is available at

http://openfoamwiki.net/index.php/Contrib_funkySe tFields

For instance the velocity field Melanie specified on the 20th:

r = x^2 + y^2
U[x] = y * a/ r^2
U[y] = -x * b/ r^2

could be set with the utility with the call (assuming a and b to be 1 and 2):

funkySetFields . theCase -field U -expression 'vector(pos().y*1/pow(mag(pos()),4),-pos().x*2/pow(mag(pos()),4),0)' -time 0

Another example would be setting the initial condition for the damBreak-tutorial:

funkySetFields . damBreak -time 0 -field gamma -expression " pos().x <= 0.1461 && pos().y <= 0.292 ? 1 : 0"

or (if you don't want to overwrite the whole gamma field):

funkySetFields . damBreak -time 0 -field gamma -expression 1 -condition "pos().x <= 0.1461 && pos().y <= 0.292"

anja March 28, 2006 05:54

Hi, can someone please expl
 
Hi,

can someone please explain me, what the following line defines

forAll(mesh.cells(),cellI)
scalar x = mesh.C()[cellI].component(0)

Thanks
Anja

gschaider March 28, 2006 06:19

C() is described in Table 2.1
 
C() is described in Table 2.1 of the Programmer's guide. component() accesses components of a tensor/vector.

anja March 28, 2006 06:56

so then why is it component(0
 
so then why is it component(0 ?! )

gschaider March 28, 2006 07:15

Because C++ (==Foam) starts to
 
Because C++ (==Foam) starts to count with 0 (as opposed to Fortran which starts with 1). Therefor the first component (== x-coordinate) is accessed with the index 0.

hjasak March 28, 2006 07:37

OK, let's do chapter and verse
 
OK, let's do chapter and verse on this:

1) OpenFOAM field class is called GeometricField and it can contain scalars, vectors, tensors etc. These things are defined as surfaceScalarField, volVectorField, pointScalarField, volTensorField etc.

2) For some of those fiels it makes sense to ask for a component. So, if I've got a volVectorField, I could ask for the x() component (this is a sensible and meaningful operation), whereas for the volTensorField I may asn for the xy() component. How do I do that?

Well, since volVectorField is a GeometricField<vector,>, I cannot add the x() member function to it - it would not make sense for scalar or tensor fields, right? Thus, I need a general way to as for a component of a field.

3) The first step is in the definition of scalars, vectors and tensors. Here, I define two things:
- an enumeration for the component. For a vector, this will say X, Y, Z and for a tensor XX, XY, XZ, YX, YY, YZ, etc. Note that enumeration is basically an int wrapped up for use and that the count starts from zero. Thus, in a vector X is 0, Y is 1 etc. and the tensor you can work it out yourself.
- a member function returning a component. Thus, you know what the following bit of the code does:


vector a(1, 2, 3);
a.component(vector::Y);


Now, we can pull through the component function through the fields and GeometricFields. Examples:


vectorField a(10);
// fill it up
scalarField ax = a.component(vector::X);


or


tensorField t(33);
scalarField tyz = t.component(tensor::YZ);


Alll clear, I hope.

Thus:

- mesh.C() returns a volVectorField of cell centres.
- mesh.C()[cellI] gets the cellI element from the internal field (you have jumped into the internal field directly because the GeometricField is derived from the internal field.
- mesh.C()[cellI].component(0) is equivalent to mesh.C()[cellI].component(vector::X), which should be clear.

Note that you can also do:

volScalarField cx = mesh.C().component(vector::X);

or

scalarField cxIn = mesh.C().internalField().component(vector::X);


Better?

Enjoy,

Hrv

anja March 28, 2006 07:50

Thanks a lot
 
Thanks a lot

anne May 22, 2006 12:24

Hello, I would like to read
 
Hello,

I would like to read the velocity
field U obtained as an output in time directory.

My mesh is made of several blocks.
when using one block I had no problem to read
the file through the loop:

do k=1,nz
do j=1,ny
do i=1,nx
...
where nx ,ny and nx were the total number of cell.

However, now using several blocks in the
0x, 0y and 0z directions I can not
read correctely the file.
(Looking at the file with ParaFoam all
is OK, so that the file is OK).

Could you let me know the writing format of the
output file when uing several blocks?
Is this a writing block by block?

Thanks,

Anne

msrinath80 May 27, 2007 04:08

Can someone verify if I'm doin
 
Can someone verify if I'm doing this right using funkySetFields. I wish to create a sphere of radius 0.5 in the center of the 3D geometry. The syntax I'm using is:

funkySetFields . cavity -field gamma -expression '(grad(dist())^vector(0,0,0))*mag(pos()-vector(0.5,0.5,0.5))/0.5' -time 0

If this is incorrect, I would appreciate if someone can help. Thanks!

gschaider May 29, 2007 07:15

Hi! I would suggest funk
 
Hi!

I would suggest

funkySetFields . cavity -field gamma -condition "mag(pos()-vector(0.5,0.5,0.5))<0.5" -expression "1." -time 0 -keepPatches

assuming that (0.5,0.5,0.5) is the center of your geometry and gamma originally was set to "uniform 0"
Whatever the other stuff in your example does it is going to become zero because of the product with vector(0,0,0).

Bernhard

hjasak May 29, 2007 07:51

Only one word for you Bernhard
 
Only one word for you Bernhard: BEAUTIFUL!

Hrv

msrinath80 May 29, 2007 13:53

Thanks Bernhard. That was very
 
Thanks Bernhard. That was very useful http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

msrinath80 June 15, 2007 13:20

Hi Bernhard, funkySetFields
 
Hi Bernhard,

funkySetFields[1] compiles and runs as intended on OF 1.3. However, OF 1.4 does not like it. Can you post the API modifications required for it to work on OF 1.4.

Thanks!

[1] http://openfoamwiki.net/images/7/79/...s.r7241.tar.gz

7islands June 17, 2007 04:00

Hi, One might be able to try
 
Hi,
One might be able to try this patch (with some modifications for my own purpose) until Bernhard makes a new release (I believe it won't be so long anyway) for OF 1.4. This contains
* harsh fix for building problem and SIGFPE crash by constant scalar division on OF 1.4
* deltaT(): returns the value of deltaT in controlDict
* rdist(x, y, z): equivalent of mag(pos() - vec(x,y,z)) where x, y, z are scalars

Takuya

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif funkySetFields.r7241-20070528.diff

msrinath80 June 17, 2007 05:14

Thanks Takuya. It compiled nic
 
Thanks Takuya. It compiled nicely!

Here are the quick instructions for those new to patching:

1. First patch the file using patch -p0 < funkySetFields.r7241-20070528.diff

2. Copy all files from the GeneratedFiles subdirectory to the current directory (i.e. directory which contains funkySetFields.C).

3. Execute wmake in the same directory.

gschaider June 20, 2007 09:23

Hi! Thanks to Takuya for hi
 
Hi!

Thanks to Takuya for his fixes. I've incorporated these into my sources (which are now updated to 1.4, plus they sould be less restrictive in their choice of a bison-version). I've also added a time()-function (don't need it, but the deltaT was there, so it seemed logical)


Description and download link:

http://openfoamwiki.net/index.php/Co...funkySetFields

http://openfoamwiki.net/images/7/79/...s.r7241.tar.gz

Bernhard

gschaider June 20, 2007 12:12

Ignor the link for the downloa
 
Ignor the link for the download in the last posting. It should have been
http://openfoamwiki.net/images/f/fe/...s.r7568.tar.gz

markdowlinguk July 27, 2007 12:31

Can somebody tell me how to ex
 
Can somebody tell me how to extract and compile the funkySetFields .gz file and which directory in which to place the files ?

Apologies for the stupid question - but I'm completely new to linux.

Thanks
Mark

qtian July 29, 2007 14:55

Hello, I am using funkySetFiel
 
Hello, I am using funkySetFields to set my non uniform inflow boundary

Here is the command I used for epsilon,

funkySetFields . nufbump -time 0 -field epsilon -keepPatches -valuePatches 'inlet' -expression '0.4983*pow(pos().y,-1.209)'

Here is the error message I got,

#0 Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&)
#1 Foam::sigFpe::sigFpeHandler(int)
#2 Uninterpreted: [0xffffe420]
#3 pow
#4 Foam::pow(Foam::Field<double>&, Foam::UList<double> const&, double const&)
#5 Foam::tmp<foam::geometricfield<double,> > Foam::pow<foam::fvpatchfield,>(Foam::GeometricFiel d<double,> const&, Foam::dimensioned<double> const&)
#6 Foam::tmp<foam::geometricfield<double,> > Foam::pow<foam::fvpatchfield,>(Foam::GeometricFiel d<double,> const&, double const&)
#7 .L25229 at ValueExpressionParser.C:0
#8 ValueExpressionDriver::parse(std::string const&)
#9 doAnExpression(Foam::fvMesh const&, Foam::word const&, Foam::string const&, Foam::string const&, Foam::Time const&, bool, bool, Foam::dimensionSet const&, bool, Foam::List<foam::word> const&)
#10 main
#11 __libc_start_main
#12 Foam::regIOobject::readIfModified()
Floating point exception (core dumped)

I also found out if I change -1.209 to 1, error message disappear. I guess this might be the format problem for pow(,),but I really don't know how to make it work. Sorry about the silly question. Can anyone give me some help? Thanks for your help.

Best
QT

msrinath80 July 29, 2007 18:09

Apologies for the delay. Here
 
Apologies for the delay. Here you go Mark:

[madhavan@head01 ~]$ cd OpenFOAM/madhavan-1.4/

[madhavan@head01 madhavan-1.4]$ ls
applications custom_utils lib run

[madhavan@head01 madhavan-1.4]$ cd custom_utils/

[madhavan@head01 custom_utils]$ cd Bernhard_Gschaider/

[madhavan@head01 Bernhard_Gschaider]$ ls
parabolic_velocity_inlet

[madhavan@head01 Bernhard_Gschaider]$ mkdir funkySetFields

[madhavan@head01 Bernhard_Gschaider]$ cd funkySetFields/

[madhavan@head01 funkySetFields]$ wget http://openfoamwiki.net/images/f/fe/...s.r7568.tar.gz
--15:59:40-- http://openfoamwiki.net/images/f/fe/...s.r7568.tar.gz
=> `FunkySetFields.r7568.tar.gz'
Resolving openfoamwiki.net... 193.171.80.115
Connecting to openfoamwiki.net|193.171.80.115|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 48,785 (48K) [application/x-tar]

100%[================================================== ===>] 48,785 102.10K/s

15:59:41 (101.89 KB/s) - `FunkySetFields.r7568.tar.gz' saved [48785/48785]

[madhavan@head01 funkySetFields]$ ls
FunkySetFields.r7568.tar.gz

[madhavan@head01 funkySetFields]$ tar xzf FunkySetFields.r7568.tar.gz

[madhavan@head01 funkySetFields]$ cd funkySetFields.r7568/

[madhavan@head01 funkySetFields.r7568]$ ls
GeneratedFiles ValueExpressionDriverLogicalTemplates.H funkySetFieldsDict
Make ValueExpressionLexer.ll getGenerated.sh
ValueExpressionDriver.C ValueExpressionParser.yy insertGenerated.sh
ValueExpressionDriver.H funkySetFields.C

[madhavan@head01 funkySetFields.r7568]$ cp -r GeneratedFiles/* .

[madhavan@head01 funkySetFields.r7568]$ wmake
Making dependency list for source file ValueExpressionParser.C
Making dependency list for source file ValueExpressionLexer.C
Making dependency list for source file funkySetFields.C
SOURCE=ValueExpressionParser.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -IMake/linux64Gcc4DPOpt -I/homes/madhavan/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/lnInclude -I/homes/madhavan/OpenFOAM/OpenFOAM-1.4/src/meshTools/lnInclude -IlnInclude -I. -I/homes/madhavan/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc4DPOpt/ValueExpressionParser.o
ValueExpressionParser.tab.cc: In member function 'unsigned char ve::ValueExpressionParser::yytranslate_(int)':
ValueExpressionParser.tab.cc:1814: warning: use of old-style cast
SOURCE=ValueExpressionLexer.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -IMake/linux64Gcc4DPOpt -I/homes/madhavan/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/lnInclude -I/homes/madhavan/OpenFOAM/OpenFOAM-1.4/src/meshTools/lnInclude -IlnInclude -I. -I/homes/madhavan/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc4DPOpt/ValueExpressionLexer.o
ValueExpressionLexer.C:245: warning: use of old-style cast
ValueExpressionLexer.C:296: warning: use of old-style cast
ValueExpressionLexer.C:296: warning: use of old-style cast
lex.ve.c: In function 'int velex(ve::ValueExpressionParser::semantic_type*, ve::location*, ValueExpressionDriver&)':
lex.ve.c:3894: warning: use of old-style cast
lex.ve.c:3894: warning: use of old-style cast
lex.ve.c:3910: warning: use of old-style cast
lex.ve.c:4229: warning: use of old-style cast
lex.ve.c: In function 'int yy_get_next_buffer()':
lex.ve.c:4397: warning: use of old-style cast
lex.ve.c:4424: warning: use of old-style cast
lex.ve.c:4437: warning: use of old-style cast
lex.ve.c:4438: warning: use of old-style cast
lex.ve.c:4459: warning: use of old-style cast
lex.ve.c: In function 'yy_state_type yy_get_previous_state()':
lex.ve.c:4507: warning: use of old-style cast
lex.ve.c:4507: warning: use of old-style cast
lex.ve.c: In function 'int yyinput()':
lex.ve.c:4664: warning: use of old-style cast
lex.ve.c: In function 'yy_buffer_state* ve_create_buffer(FILE*, int)':
lex.ve.c:4741: warning: use of old-style cast
lex.ve.c:4750: warning: use of old-style cast
lex.ve.c: In function 'void ve_delete_buffer(yy_buffer_state*)':
lex.ve.c:4773: warning: use of old-style cast
lex.ve.c:4776: warning: use of old-style cast
lex.ve.c:4778: warning: use of old-style cast
lex.ve.c: In function 'yy_buffer_state* ve_scan_buffer(char*, yy_size_t)':
lex.ve.c:4857: warning: use of old-style cast
lex.ve.c: In function 'yy_buffer_state* ve_scan_bytes(const char*, int)':
lex.ve.c:4911: warning: use of old-style cast
lex.ve.c: In function 'void yy_push_state(int)':
lex.ve.c:4950: warning: use of old-style cast
lex.ve.c:4954: warning: use of old-style cast
lex.ve.c:4954: warning: use of old-style cast
lex.ve.c: In function 'void* yy_flex_alloc(yy_size_t)':
lex.ve.c:5061: warning: use of old-style cast
lex.ve.c: In function 'void* yy_flex_realloc(void*, yy_size_t)':
lex.ve.c:5079: warning: use of old-style cast
lex.ve.c:5079: warning: use of old-style cast
lex.ve.c: At global scope:
lex.ve.c:4936: warning: 'void yy_push_state(int)' defined but not used
lex.ve.c:4969: warning: 'void yy_pop_state()' defined but not used
lex.ve.c:4980: warning: 'int yy_top_state()' defined but not used
SOURCE=ValueExpressionDriver.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -IMake/linux64Gcc4DPOpt -I/homes/madhavan/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/lnInclude -I/homes/madhavan/OpenFOAM/OpenFOAM-1.4/src/meshTools/lnInclude -IlnInclude -I. -I/homes/madhavan/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc4DPOpt/ValueExpressionDriver.o
SOURCE=funkySetFields.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -IMake/linux64Gcc4DPOpt -I/homes/madhavan/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/lnInclude -I/homes/madhavan/OpenFOAM/OpenFOAM-1.4/src/meshTools/lnInclude -IlnInclude -I. -I/homes/madhavan/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc4DPOpt/funkySetFields.o
g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -IMake/linux64Gcc4DPOpt -I/homes/madhavan/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/lnInclude -I/homes/madhavan/OpenFOAM/OpenFOAM-1.4/src/meshTools/lnInclude -IlnInclude -I. -I/homes/madhavan/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC Make/linux64Gcc4DPOpt/ValueExpressionParser.o Make/linux64Gcc4DPOpt/ValueExpressionLexer.o Make/linux64Gcc4DPOpt/ValueExpressionDriver.o Make/linux64Gcc4DPOpt/funkySetFields.o -L/homes/madhavan/OpenFOAM/OpenFOAM-1.4/lib/linux64Gcc4DPOpt \
-lfiniteVolume -lmeshTools -lOpenFOAM -liberty -ldl -lm -o /homes/madhavan/OpenFOAM/madhavan-1.4/applications/bin/linux64Gcc4DPOpt/funkySet Fields
[madhavan@head01 funkySetFields.r7568]$

PS: The first half of the instructions are not mandatory. I keep all custom utilities organized in folders. You can do the same or else put them somewhere you find convenient. On a side-note, you can survive longer in the OpenFOAM world without knowing C++, but you certainly will not if you are not familiar with the terminal/command line. My advice is to try and get familiar with it as soon as you can.

qtian July 29, 2007 20:23

Srinath or anyone, Is it po
 
Srinath or anyone,

Is it possible for you to answer my above question also? I am really stuck. Thanks.

Quinn

markdowlinguk July 31, 2007 10:25

Srinath, Huge thanks for th
 
Srinath,

Huge thanks for the very clear instructions...
It turns out I was doing something similar, but my lack of linux experience (which I'm having to rapidly overcome) made me wonder if I'd done something wrong...

Either way - when following your instructions about the program fails to compile with the following error (NB I used the insertGenerated.sh command because I have an earlier version of bison)

[PTS@tcad funkySetFields.r7568]$ . insertGenerated.sh
Preparing run to avoid usage of bison
[PTS@tcad funkySetFields.r7568]$ wmake
Making dependency list for source file ValueExpressionParser.C
Making dependency list for source file ValueExpressionLexer.C
Making dependency list for source file funkySetFields.C
Making dependency list for source file ValueExpressionDriver.C
SOURCE=ValueExpressionParser.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -IMake/linuxGcc4DPOpt -I/home/PTS/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/lnInclude -I/home/PTS/OpenFOAM/OpenFOAM-1.4/src/meshTools/lnInclude -IlnInclude -I. -I/home/PTS/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGcc4DPOpt/ValueExpressionParser.o
ValueExpressionParser.tab.cc: In member function 'unsigned char ve::ValueExpressionParser::yytranslate_(int)':
ValueExpressionParser.tab.cc:1814: warning: use of old-style cast
/tmp/ccvmLazQ.s: Assembler messages:
/tmp/ccvmLazQ.s:13: Internal error, aborting at ../../gas/config/tc-i386.c line 3501 in output_imm
Please report this bug.
make: *** [Make/linuxGcc4DPOpt/ValueExpressionParser.o] Error 1


Any ideas??

Many thanks again - in the couple of times I have used it I am struck by how rapid and helpful the responses are from the OpenFoam forum - so huge thanks to everybody for that!

Mark


All times are GMT -4. The time now is 18:26.