CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Differences OpenFOAM12 and OpenFOAM13 (http://www.cfd-online.com/Forums/openfoam-solving/58710-differences-openfoam12-openfoam13.html)

lr103476 May 3, 2006 10:42

Hello, What are the major d
 
Hello,

What are the major differences in the new version 1.3 in terms of functions?

I already noticed that the liftDrag utility has been vanished and the moving mesh routines have been changed (i think to make it easier to combine mesh changes and topology changes).

I finally managed to understand the moving meshes and to develop my own solvers in version 1.2. Right now it seems that I have to rewrite a lot.

Could someone please comment on this?

Thanks and regards,
Frank

hjasak May 3, 2006 12:16

Well, if you're missing liftDr
 
Well, if you're missing liftDrag, just take it from 1.2 and put it back in - it compiles trivially and works without trouble. For the rest, I would suggest having a look at the announcements and discussions.

Hrv

msrinath80 June 25, 2006 06:34

I just finished including the
 
Quote:

I just finished including the liftDrag utility into OpenFOAM 1.3 as Hrv mentioned.

Here are the instructions (for the AMD64 architecture) on how to do this (for new users):


Step 1: Grab the relevant OpenFOAM 1.2 gzipped tarballs:

(a) wget http://internap.dl.sourceforge.net/s...2.General.gtgz
(b) wget http://internap.dl.sourceforge.net/sourceforge/foam/OpenFOAM-1.2.linuxAMD64Gcc4O pt.gtgz


Step 2: Create a temporary directory for OpenFOAM 1.2 and unpack the downloaded files into it:

[username@hostname ~]$ mkdir foam12
[username@hostname ~]$ cd foam12
[username@hostname foam12]$ tar xzf OpenFOAM-1.2.General.gtgz
[username@hostname foam12]$ tar xzf OpenFOAM-1.2.linuxAMD64Gcc4Opt.gtgz
[username@hostname foam12]$ ls
OpenFOAM-1.2 OpenFOAM-1.2.General.gtgz OpenFOAM-1.2.linuxAMD64Gcc4Opt.gtgz


Step 3: Find the relevant portions that need to be copied:

[username@hostname foam12]$ find ./ -name liftDrag -print
/home/username/foam12/OpenFOAM-1.2/applications/utilities/postProcessing/miscell aneous/liftDrag
/home/username/foam12/OpenFOAM-1.2/applications/bin/linuxAMD64Gcc4Opt/liftDrag
/home/username/foam12/OpenFOAM-1.2/src/postProcessing/incompressible/liftDrag

We are interested in the first and third directories. The second entry is merely a pre-compiled binary (which we will recreate anyway, so let us not bother about it).


Step 4: Copy the missing directories into the OpenFOAM 1.3 installation (~/OpenFOAM/OpenFOAM-1.3/ in this example):

[username@hostname foam12]$ cp -r ./OpenFOAM-1.2/src/postProcessing/ ~/OpenFOAM/OpenFOAM-1.3/src/
[username@hostname foam12]$ cp -r ./OpenFOAM-1.2/applications/utilities/postProcessing/miscellaneous/liftDrag/ ~/OpenFOAM/
OpenFOAM-1.3/applications/utilities/postProcessing/miscellaneous/


Step 5: Edit the 'options' file to suit OpenFOAM 1.3:

The two 'options' files are located at:

(a) ~/OpenFOAM/OpenFOAM-1.3/applications/utilities/postProcessing/miscellaneous/lift Drag/Make/options
(b) ~/OpenFOAM/OpenFOAM-1.3/src/postProcessing/incompressible/Make/options

Under the EXE_INC section in each of the above files, change -I$(LIB_SRC)/cfdTools/general/lnInclude to -I$(LIB_SRC)/finiteVolume/lnInclude/

The need for this change is explained in the Wiki[1].


Step 6: Update the libincompressiblePostProcessing.so shared library:

[username@hostname ~]$ cd OpenFOAM/OpenFOAM-1.3/src/postProcessing/
[username@hostname postProcessing]$ ./Allwmake


Step 7: Finally, build the liftDrag binary:

[username@hostname ~]$ cd OpenFOAM/OpenFOAM-1.3/applications/utilities/postProcessing/miscellaneous/liftDr ag/
[username@hostname liftDrag]$ wclean && wmake


And there you have it, trivially compiled ;)


References:

[1] http://openfoamwiki.net/index.php/HowTo_port_from _older_versions_to_13

shaun May 8, 2007 04:20

Hi, I am using the Ubuntu linu
 
Hi, I am using the Ubuntu linux OS (dapper) and am trying to include the LiftDrag utility as described in this post above.

When I run ./Allwmake as described in Step 6 I get the following error:

lads@PhantomWorks:~/OpenFOAM/OpenFOAM-1.4/src/postProcessing$ ./Allwmake
g++: no input files
make: *** [libNULL.so] Error 1
lads@PhantomWorks:~/OpenFOAM/OpenFOAM-1.4/src/postProcessing$

I am not brilliant at this stuff. The error may seem obvious to others but I don't know how to get past this.

Can anyone help me please?

Thank you

Shaun.D

shaun May 8, 2007 04:37

Please note that after trying
 
Please note that after trying to start from scratch, at Step 6 I get the following error:

lads@PhantomWorks:~/OpenFOAM/OpenFOAM-1.4/src/postProcessing$ ./Allwmake
/bin/sh: /lib/cpp: No such file or directory
make: *** [linux64Gcc4DPOpt/options] Error 127
/bin/sh: /lib/cpp: No such file or directory
make: *** [linux64Gcc4DPOpt/files] Error 127
/home/lads/OpenFOAM/OpenFOAM-1.4/wmake/wmake: cannot make, file Make/linux64Gcc4DPOpt/objectFiles was not created successfully
lads@PhantomWorks:~/OpenFOAM/OpenFOAM-1.4/src/postProcessing$

I looked in the /lib directory and indeed there is no cpp folder. What is this please?

The error I reported earlier occurs after I try the ./Allwmake command again.

Are there any thoughts please?

Thank you

Shaun.D

shaun May 9, 2007 00:31

OK. So I got past this stage a
 
OK. So I got past this stage after updating my Ubuntu OS.

When I run "wclean && wmake" in step 7 I get the following error reported

lads@PhantomWorks:~/OpenFOAM/OpenFOAM-1.4/applications/utilities/postProcessing/miscellaneous/lif tDrag$ wclean && wmake
Making dependency list for source file liftDrag.C
SOURCE=liftDrag.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/home/lads/OpenFOAM/OpenFOAM-1.4/src/postProcessing/incompressible/lnInclude -I/home/lads/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/lnInclude -I/home/lads/OpenFOAM/OpenFOAM-1.4/src/transportModels -I/home/lads/OpenFOAM/OpenFOAM-1.4/src/turbulenceModels -I/home/lads/OpenFOAM/OpenFOAM-1.4/src/LESmodels -I/home/lads/OpenFOAM/OpenFOAM-1.4/src/LESmodels/LESdeltas/lnInclude -IlnInclude -I. -I/home/lads/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc4DPOpt/liftDrag.o
g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/home/lads/OpenFOAM/OpenFOAM-1.4/src/postProcessing/incompressible/lnInclude -I/home/lads/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/lnInclude -I/home/lads/OpenFOAM/OpenFOAM-1.4/src/transportModels -I/home/lads/OpenFOAM/OpenFOAM-1.4/src/turbulenceModels -I/home/lads/OpenFOAM/OpenFOAM-1.4/src/LESmodels -I/home/lads/OpenFOAM/OpenFOAM-1.4/src/LESmodels/LESdeltas/lnInclude -IlnInclude -I. -I/home/lads/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC Make/linux64Gcc4DPOpt/liftDrag.o -L/home/lads/OpenFOAM/OpenFOAM-1.4/lib/linux64Gcc4DPOpt \
-lincompressiblePostProcessing -lfoamUtil -lOpenFOAM -liberty -ldl -lm -o /home/lads/OpenFOAM/OpenFOAM-1.4/applications/bin/linux64Gcc4DPOpt/liftDrag
/usr/bin/ld: cannot find -liberty
collect2: ld returned 1 exit status
make: *** [/home/lads/OpenFOAM/OpenFOAM-1.4/applications/bin/linux64Gcc4DPOpt/liftDrag] Error 1


what is this -liberty option please?

Thanks for your help

Shaun.D

shaun May 10, 2007 00:55

Compiled successfully. I had t
 
Compiled successfully. I had to install the binutils-dev package.

Thanks

Shaun.D

msrinath80 May 10, 2007 13:39

Thanks for reporting what solv
 
Thanks for reporting what solved your problem http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

msrinath80 May 10, 2007 13:41

Oh and there is a very minor b
 
Oh and there is a very minor bug in the original OF 1.2 liftDrag.C/H files. Please check this thread and make appropriate changes.

http://www.cfd-online.com/OpenFOAM_D...tml?1176825339

paka July 18, 2007 21:41

I use version 1.4, on Intel64.
 
I use version 1.4, on Intel64. As follows in the above tutorial, I get through all the steps. The only thing which I change are files in:

~/OpenFOAM/OpenFOAM-1.4/src/postProcessing/incompressible/lnInclude

in which, who knows why (maybe old structure), both files from downloaded 1.2 distribution (in lnInclude), such as: linkDrag.C and linkDrag.H, point to non existent file like:
../fields/fvPatchFields/derivedFvPatchFields/pressureInletUniformVelocity/pressu reInletUniformVelocityFvPatchVectorField.H

It doesn't seem to be right. Anyway, I fix it, by changing links to:
ln -s ~/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/fields/fvPatchFields/derivedFvPatchFiel ds/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C liftDrag.C
and
ln -s ~/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/fields/fvPatchFields/derivedFvPatchFiel ds/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.H liftDrag.H

Till that point seems to be OK.

Than, I go to ~/OpenFOAM/OpenFOAM-1.4/src/postProcessing/ and invoke the ./Allwmake.
Output: bla_path_bla/libincompressiblePostProcessing.so' is up to date.
OK.

Finally, the last step. I invoke: wclean && wmake

Here is an output which I receive:

Making dependency list for source file liftDrag.C
SOURCE=liftDrag.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/share/kiwiraid/krystian/OpenFOAM/OpenFOAM-1.4/src/postProcessing/incompressib le/lnInclude -I/share/kiwiraid/krystian/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/lnInclude/ -I/share/kiwiraid/krystian/OpenFOAM/OpenFOAM-1.4/src/transportModels -I/share/kiwiraid/krystian/OpenFOAM/OpenFOAM-1.4/src/turbulenceModels -I/share/kiwiraid/krystian/OpenFOAM/OpenFOAM-1.4/src/LESmodels -I/share/kiwiraid/krystian/OpenFOAM/OpenFOAM-1.4/src/LESmodels/LESdeltas/lnInclu de -IlnInclude -I. -I/share/kiwiraid/krystian/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc4DPOpt/liftDrag.o
liftDrag.C: In function 'int main(int, char**)':
liftDrag.C:140: error: 'dragCoefficient' was not declared in this scope
liftDrag.C:150: error: 'liftCoefficient' was not declared in this scope
liftDrag.C:161: error: 'momentCoefficient' was not declared in this scope
make: *** [Make/linux64Gcc4DPOpt/liftDrag.o] Error 1


What might be wrong?

Any input appreciated.
K

msrinath80 July 19, 2007 01:58

I cannot find any reference to
 
I cannot find any reference to ../fields/fvPatchFields/derivedFvPatchFields/pressureInletUniformVelocity/pressu reInletUniformVelocityFvPatchVectorField.H in either liftDrag.C or liftDrag.H. Can you specify where exactly you find these lines?

paka July 19, 2007 02:27

The two files (liftDrag.C & li
 
The two files (liftDrag.C & liftDrag.H) in inInclude folder are aliases (other way speaking, links) pointing to different files.

The first two letters in the name of the folder even indicate that this folder might contain links.

When you type ls -l you can see to where these files point to.

The path which you quoted is that path to which these aliases point to.

K

msrinath80 July 19, 2007 02:53

There seems to be a problem in
 
There seems to be a problem in your case. I checked the OpenFOAM 1.2 sources again:

madhavan@varese:~/downloads/foam12/OpenFOAM-1.2/src/postProcessing/incompressible/lnInclude> ls -la
total 0
drwxr-xr-x 2 madhavan users 136 2006-08-24 13:15 .
drwxr-xr-x 5 madhavan users 128 2006-08-24 13:15 ..
lrwxrwxrwx 1 madhavan users 22 2006-08-24 13:15 liftDrag.C -> ../liftDrag/liftDrag.C
lrwxrwxrwx 1 madhavan users 22 2006-08-24 13:15 liftDrag.H -> ../liftDrag/liftDrag.H
-rw-r----- 1 madhavan users 0 2005-08-08 09:20 uptodate
madhavan@varese:~/downloads/foam12/OpenFOAM-1.2/src/postProcessing/incompressible/lnInclude>

As you can see all symbolic links point to correct files. I've even tried recompiling the liftDrag utility from scratch (verbatim using the above posted instructions) and it works flawlessly. If you have made customizations to your OpenFOAM installtion, perhaps you should review the modifications again.

If I understand it correctly, the following command[1] suggests that you are trying to create a soft link with source file as pressureInletUniformVelocityFvPatchVectorField.C and target file as liftDrag.C. I don't see the need for such a connection? Please correct me if I am wrong.

[1] ln -s ~/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/fields/fvPatchFields/derivedFvPatchFiel ds/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C liftDrag.C

paka July 19, 2007 03:43

Indeed, I made one customizati
 
Indeed, I made one customization. However, related to $HOME path in the original OpenFOAM-1.4 version, which does not have any influence on added liftDrag directories.

Nonetheless, thanks for the correct links. Now soft link seems resonable. Do not know how I got a wrong link - I didn't do anything. I will check it tomorrow.

Now, code compiled and seems to be working, but...

...is there any limitation in liftDrag? I mean, does it work only with some specified output from particular solvers?

I work with rasInterFoam solver, but when I try to run it on any case example which I did so far I always get the same output:


/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.4 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

Exec : liftDrag . TankTest2D_plate50cm
Date : Jul 18 2007
Time : 21:33:00
Host : kiwi.soest.hawaii.edu
PID : 17969
Root : /share/kiwiraid/krystian/OpenFOAMJobs
Case : TankTest2D_plate50cm
Nprocs : 1
Create time

Create mesh for time = 0



--> FOAM FATAL IO ERROR : keyword nu is undefined in dictionary "/share/kiwirai
d/krystian/OpenFOAMJobs/TankTest2D_plate50cm/constant/transportProperties"

file: /share/kiwiraid/krystian/OpenFOAMJobs/TankTest2D_plate50cm/constant/transp
ortProperties from line 27 to line 74.

From function dictionary::lookupEntry(const word& keyword) const
in file db/dictionary/dictionary.C at line 146.

FOAM exiting


clearly says the nu is not defined, but it is in phase1 definition in turbulentProperties file.

K

msrinath80 July 19, 2007 05:51

Try it on the cavity case. It
 
Try it on the cavity case. It should work. I have tested it only on single-phase cases. It needs modifications for multiphase flow.

paka July 19, 2007 06:17

So what I understand, presentl
 
So what I understand, presently, there is no way to obtain these forces for multi-phase flows?
I need to compare the time history of max uplift force acting on the structure.

For icoFoam/cavity I get:

Create mesh for time = 0

Time = 0
Reading U

Reading p

Inlet velocity: (1 0 0)
#0 Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&)
#1 Foam::sigFpe::sigFpeHandler(int)
#2 __restore_rt
#3 Foam::momentCoefficient(Foam::GeometricField<foam: :vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double,> const&, Foam::dimensioned<double> const&, Foam::word const&, Foam::Vector<double> const&, double const&, double const&)
#4 main
#5 __libc_start_main
#6 __gxx_personality_v0
Floating point exception


BTW. I'm willing to have some input to extend it to multi-phase flow. I'm just afraid my C++ plus OpenFOAM knowledge is not enough. If I could get any tips than at least I can start with something.
Will the code be much different than for single-phase flow?

msrinath80 July 19, 2007 06:44

It seems to work here: Exec
 
It seems to work here:

Exec : liftDrag . cavity -time 0.5
Date : Jul 19 2007
Time : 04:31:08
Host : sunfire
PID : 19347
Root : /home/madhavan/OpenFOAM/madhavan-1.4/run/tutorials/icoFoam
Case : cavity
Nprocs : 1
Create time

Create mesh for time = 0.5

Time = 0.5
Reading U

Reading p

Inlet velocity: (1 0 0)
Wall patch 0 named movingWall :
Reference area: 0 Reference length: 0.1 Drag coefficient: nan Lift coefficient: (nan nan nan) Moment coefficient: (-inf nan inf)
Wall patch 1 named fixedWalls :
Reference area: 0.001 Reference length: 0.1 Drag coefficient: 2.50095 Lift coefficient: (0 -0.125482 0) Moment coefficient: (0.0062741 0.125048 -3.01554)

The nan's are because the reference area value for the movingWall patch is equal to zero.

For the record, I don't use the liftDrag binary as it is. I have copied several force-calculating routines from liftDrag.C/H and included them in a separate header computeForces.H, which is then included inside icoFoam.C after runtime.write(). Check the discussion forum for liftDrag related posts (esp. the ones with Hrv and Frank Bos) and you'll know what I mean.

paka July 19, 2007 20:51

I'll try the other liftDrag.C/
 
I'll try the other liftDrag.C/H files tomorrow.

Coming back to liftDrag code for two-phase flow. Maybe I'm mistaken, but from theoretical point of view it seems quite "staight-forward" comparing to one-phase flow.

Force acting on structure is just an integral of the pressure acting on the structure. Therefore, there shouldn't be a big problem extending the code to two-phase flow. Am I right?

Actually, in my understanding, the liftDrag is a post-processing tool. So, based on the output files from solver run the lift and drag forces are obtained. Is it right?
I guess...

Could anybody, involved in that code before, give me a tip what is the trouble to apply it to two-phase flow? What should modified?

Thanks,
K

paka July 19, 2007 21:18

BTW. Before liftDrag brakes an
 
BTW. Before liftDrag brakes and quits as described above, it says it reads U filed. I guess this is for the drag and lift coefficients computation, right?

For force computation I only need pressure: p (or pd).
and integrate.

narls July 30, 2007 21:57

krystian, how did you solve
 
krystian,

how did you solve this error:

#0 Foam::error::printStack(Foam:stream&)
#1 Foam::sigFpe::sigFpeHandler(int)
#2 __restore_rt
#3 Foam::momentCoefficient(Foam::GeometricField<foam: :vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double,> const&, Foam::dimensioned<double> const&, Foam::word const&, Foam::Vector<double> const&, double const&, double const&)
#4 main
#5 __libc_start_main
#6 __gxx_personality_v0
Floating point exception

i am getting the same message using v1.4 on fedora for the cavity example ....
am looking now in the forum for any clues but would really appreciate it if you could explain how you solved it

cheers


All times are GMT -4. The time now is 23:40.