|
[Sponsors] |
March 14, 2008, 04:24 |
hi everybody, me again with a
|
#1 |
Member
robert maduta
Join Date: Mar 2009
Posts: 33
Rep Power: 17 |
hi everybody, me again with a problem :-)
i now try to run my rans channel flow with cyclic boundary conditions, therefor i have to ad an extra term to the u eq in simpleFoam.C to keep a constant pressure gradient along the channel. i really dont have a clue how to modify the u eq. i tried to do it like this: fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) + 0.018 ); where 0.018 is the constant. this isnt working and it isnt compiling. maybe someone can help and tell me how to exactly implement the term. thx greetings robert |
|
March 14, 2008, 06:50 |
hi,
0.018 is a scalar not a
|
#2 |
Senior Member
Stephan Gerber
Join Date: Mar 2009
Location: Germany
Posts: 118
Rep Power: 17 |
hi,
0.018 is a scalar not an vector while U is a vector. try to put the 0.018 as a component of a vector - this should work. stephan |
|
March 14, 2008, 09:56 |
You must add volVectorField wi
|
#3 |
Senior Member
Marhamat Zeinali
Join Date: Mar 2009
Location: Tehran, Tehran, iran
Posts: 107
Rep Power: 17 |
You must add volVectorField with correct dimension
|
|
March 14, 2008, 15:22 |
is there an example where i ca
|
#4 |
Member
robert maduta
Join Date: Mar 2009
Posts: 33
Rep Power: 17 |
is there an example where i can have a look in the code where a constant term is added? do i only have to add the term + volVectorField(0.018, 0, 0)?
|
|
March 14, 2008, 18:17 |
Hello Robert,
you can add i
|
#5 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Hello Robert,
you can add it exactly as g (gravity) is added. For sake of simplicity of use, just add the vector you want to add to the momentum equation to your transportProperties dictionary (check dimensions): myVector myVector [0 1 -1 0 0 0 0] (0.018 0 0); then read it in createFields.H after the dictionary declaration: dimensionedVector myVector ( transportProperties.lookup("myVector") ); and then add it to the equation ( ... + myVector). Regards, Alberto
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. |
|
March 14, 2008, 18:18 |
I mean you must define new va
|
#6 |
Senior Member
Marhamat Zeinali
Join Date: Mar 2009
Location: Tehran, Tehran, iran
Posts: 107
Rep Power: 17 |
I mean you must define new variable as a volVectorField with correct dimension.
>such as: volVectorField NSconstant=fvm::ddt(U); forAll(mesh.C(),i) { NSconstant[i]=(0.018,0,0); } >then fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) + NSconstant ) |
|
March 14, 2008, 23:46 |
You're right. Just shorter:
|
#7 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
You're right. Just shorter:
volScalarField myVectorField("myVectorField", myVector & mesh.C()); Regards, Alberto
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. |
|
March 15, 2008, 01:36 |
Thank's Alberto
I prefere you
|
#8 |
Senior Member
Marhamat Zeinali
Join Date: Mar 2009
Location: Tehran, Tehran, iran
Posts: 107
Rep Power: 17 |
Thank's Alberto
I prefere your method too. |
|
March 15, 2008, 09:02 |
well since my knowledge in c++
|
#9 |
Member
robert maduta
Join Date: Mar 2009
Posts: 33
Rep Power: 17 |
well since my knowledge in c++ is very very small i try to do it the first way described by alberto. as i understodd there has to be a file (transportproperties) where i first have to define this 0.018. then i have to ad it in the createfields so that the incompressible solver can read it. then i can finally ad the term in the momentum equation. well i managed to change the createfields the proper way and also put in the term in the momentum eq. but i cant find the transportProperties file where i have to ad
myVector myVector [0 1 -1 0 0 0 0] (0.018 0 0); maybe you can help me out? |
|
March 15, 2008, 10:11 |
hi,
go to the tutorials-dir
|
#10 |
Senior Member
Stephan Gerber
Join Date: Mar 2009
Location: Germany
Posts: 118
Rep Power: 17 |
hi,
go to the tutorials-dir in one of the cases from settlingFoam - there is a file called actually "environmentalProperties". just give the file a new name. regards stephan |
|
March 15, 2008, 10:35 |
Robert,
I wrote a tutorial
|
#11 |
Senior Member
Michael Jaworski
Join Date: Mar 2009
Location: Champaign, IL, USA
Posts: 126
Rep Power: 17 |
Robert,
I wrote a tutorial on adding a scalar transport equation and modifying the transportProperties dictionary (and how to read these things in openFOAM). It's on the wiki and maybe you can use it to help write your solver: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam Good luck, Mike J. |
|
March 16, 2008, 09:34 |
hi all, i posted this message
|
#12 |
Member
robert maduta
Join Date: Mar 2009
Posts: 33
Rep Power: 17 |
hi all, i posted this message under the installation topics and now also here so that maybe you have an idea.
i did everything the way how michael described it in the tutorial he wrote. the problem is that when i try to compile everything i got the following error message: robert@robert-laptop:~/OpenFOAM/OpenFOAM-1.4.1/applications/solvers/incompressible/simpleFoam$ wmake g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/robert/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -I/home/robert/OpenFOAM/OpenFOAM-1.4.1/src/turbulenceModels -I/home/robert/OpenFOAM/OpenFOAM-1.4.1/src/transportModels -IlnInclude -I. -I/home/robert/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -pthread Make/linuxGccDPOpt/simpleFoam.o -L/home/robert/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt \ -lincompressibleTurbulenceModels -lincompressibleTransportModels -lfiniteVolume -lmeshTools -lOpenFOAM -ldl penFOAM/linux/gcc-4.2.1/lib/libiberty.a -o /home/robert/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/simpleFoam g++: penFOAM/linux/gcc-4.2.1/lib/libiberty.a: No such file or directory make: *** [/home/robert/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/simpleFoam] Error 1 robert@robert-laptop:~/OpenFOAM/OpenFOAM-1.4.1/applications/solvers/incompressible/simpleFoam$ do i have to install any extra package to get rid of the problem? i already installed the binutils-dev package some time ago. i hope someone canhelp me |
|
March 16, 2008, 11:32 |
hi,
there should be a page
|
#13 |
Senior Member
Stephan Gerber
Join Date: Mar 2009
Location: Germany
Posts: 118
Rep Power: 17 |
hi,
there should be a page called "how to compile openfoam". on this page you will find answers about the missing libiberty - i guess a partial reinstall of the binutils is what you need. regards stephan |
|
March 16, 2008, 16:56 |
Robert,
Try to go to /home/ro
|
#14 |
New Member
David Palko
Join Date: Mar 2009
Location: Stockholm
Posts: 17
Rep Power: 17 |
Robert,
Try to go to /home/robert/OpenFOAM/linux/gcc-4.2.1/lib and check if you have the file libiberty.a there. If not, try to download gcc-4.2.1 from OpenFoam webpage once more and unpack it. Maybe it helps. David |
|
March 17, 2008, 04:06 |
jep, i already have the file.
|
#15 |
Member
robert maduta
Join Date: Mar 2009
Posts: 33
Rep Power: 17 |
jep, i already have the file. well i installed on another machine now suse and there after downloading the packages compiling works.
with adding a source term which has the exact value of my pressure gradient and setting pressure and everything as cyclic i dont get the suspected results. i took 700 cells in channel height direction and 2 to 4 in channel lenght direction. the solution always gives cyclic positive velocities at channel inlet and outlet and in the channel half negative velocities. should i change the number of cells in channel length direction to 1? |
|
March 17, 2008, 07:32 |
just to give an update. i thin
|
#16 |
Member
robert maduta
Join Date: Mar 2009
Posts: 33
Rep Power: 17 |
just to give an update. i think adding only a source term to the equation and choosing cyclic boundary conditions is not possible. i think the mass conservation is not necessarily fulfilled. i am trying to do my channel flow simulation now with boundaryFoam since i heard it works already with correctors for the mass conservation. the problem is that i dont see the boundaryFoam application in my FoamX-GUI. anyone knows what to do?
|
|
April 14, 2008, 05:35 |
hi,
i am trying to add a conc
|
#17 |
Member
davey david
Join Date: Mar 2009
Posts: 54
Rep Power: 17 |
hi,
i am trying to add a concentration equation to the icofoam solver to cater for different liquids of different concentrations.how do i go about it?should i follow the same procedure as how to add temperature? thanks davey |
|
April 14, 2008, 10:25 |
hi Mike J,
i was trying to fo
|
#18 |
Member
davey david
Join Date: Mar 2009
Posts: 54
Rep Power: 17 |
hi Mike J,
i was trying to follow your tutorial to add an equation(for concentration) to the icofoam solver but it seems not to be working for me.could you explain,please,how you got this eqn: fvScalarMatrix TEqn ( fvm::ddt(T) + fvm::div(phi, T) - fvm::laplacian(DT, T) ); TEqn.solve? i am new to Openfoam and cfd and cant seem to get around this obstacle. thanks davey |
|
March 19, 2009, 03:47 |
inquiry
|
#19 |
New Member
andrianomena
Join Date: Mar 2009
Location: madagascar
Posts: 23
Rep Power: 17 |
Hi there,
I'm kinda new to openfoam, and now I'm trying to learn more about it, it's very interesting but little hard. I got a question. Can anybody comment a bit on this piece of code (it is in turbfoam code): volScalarField rUA = 1.0/UEqn.A(); U = rUA*UEqn.H(); ....... U-=rUA*fvc::grad(p); what I dont get is the 'UEqn.A()' (access function?) and the "U-=rUA*fvc::grad(p)" last one, what does "fvc::interpolate(U) & mesh.Sf()" I know the syntax interpolate but my trouble is the meaning of "& mesh.Sf()" |
|
March 19, 2009, 03:54 |
inquiry
|
#20 |
New Member
andrianomena
Join Date: Mar 2009
Location: madagascar
Posts: 23
Rep Power: 17 |
Hi there,
I'm kinda new to openfoam, and now I'm trying to learn more about it, it's very interesting but little hard. I got a question. Can anybody comment a bit on this piece of code (it is in turbfoam code): volScalarField rUA = 1.0/UEqn.A(); U = rUA*UEqn.H(); ....... U-=rUA*fvc::grad(p); what I dont get is the 'UEqn.A()' (access function?) and the "U-=rUA*fvc::grad(p)" last one, what does "fvc::interpolate(U) & mesh.Sf()" I know the syntax interpolate but my trouble is the meaning of "& mesh.Sf()" |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding Source term of a new field at the inlet | vatant | OpenFOAM Running, Solving & CFD | 0 | October 14, 2006 16:42 |
Adding Source term of a new field at the inlet | vatant | OpenFOAM Running, Solving & CFD | 0 | October 14, 2006 16:39 |
Adding a momentum source term | segersson | OpenFOAM Running, Solving & CFD | 5 | March 3, 2006 00:06 |
Adding a source term to continuity eqn(UDF) | Sebeci | FLUENT | 0 | April 20, 2003 04:12 |
adding source term confusion | tedmcc | CFX | 4 | September 27, 2001 06:05 |