|
[Sponsors] |
Defining convergent gravity field! please Help me |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 28, 2012, 04:23 |
Defining convergent center-oriented gravity field! please Help me
|
#1 |
Senior Member
|
Hi everybody,
any one know how can I define a convergent (center-oriented) gravity field in OF? I have a sphere that have a convergent gravity field. Thank you Last edited by adambarfi; July 28, 2012 at 07:48. |
|
July 28, 2012, 07:41 |
|
#3 |
Senior Member
|
Hi Nima,
Assume we want to solve convection heat transfer in a spherical body that it has a gravity field. for example the earth, the earth gravity vectors are perpendicular to the surface and they are intersecting each other at the center of sphere(earth- a center-oriented field). Do you know how can I define such gravity field that varies with radius of sphere? Thank you |
|
July 28, 2012, 09:00 |
|
#4 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
it is possible with some pieces of coding:
i have an idea, instead of using a dimensionVector "g" , define a VolVectorField "g" then, using funkySetField or setField utility to define a non-uniform "g" |
|
July 28, 2012, 09:14 |
|
#5 |
Senior Member
|
||
July 29, 2012, 02:07 |
|
#6 |
Senior Member
A_R
Join Date: Jun 2009
Posts: 122
Rep Power: 17 |
Dear adam
it seems that your field is constant over time. the simplest way is to look how the points are written in constant/points. then write a code with a programming language to create a non uniform distribution. |
|
July 29, 2012, 03:03 |
|
#7 |
Senior Member
|
||
July 29, 2012, 07:24 |
|
#8 | |
Senior Member
|
Quote:
I try but I couldn't do it, I never did it before and I'm pretty a new user of OF. can you give me more information about defining this field or an example? thank you |
||
July 29, 2012, 08:21 |
|
#9 |
Senior Member
A_R
Join Date: Jun 2009
Posts: 122
Rep Power: 17 |
Dear mahmoud
do you use blockmesh. if yes, send me your case to describe you |
|
July 29, 2012, 11:39 |
|
#10 |
Senior Member
|
||
July 29, 2012, 12:33 |
|
#11 |
Senior Member
A_R
Join Date: Jun 2009
Posts: 122
Rep Power: 17 |
if you can please show it in the site for better understanding
|
|
July 29, 2012, 14:08 |
|
#12 |
Senior Member
|
its file size is about 19Mb. so I attach you a picture.
it is similar to the earth, it has a hot core and its surface is at ambient temperature. assume that the mantle of earth is a fluid. I want to solve the convection in mantle. Thank you niaz Mostafa Mahmoudi |
|
July 29, 2012, 15:45 |
|
#13 |
Senior Member
A_R
Join Date: Jun 2009
Posts: 122
Rep Power: 17 |
Dear adam
if you set your center to (0 0 0) you can use your point for creating the fields. you should define a vector field then use your points to calculate the vector. gfield=g*(x/R*i+y/R*j+z/R*k) R=(x2+y2+z2)^1/2 |
|
July 29, 2012, 16:04 |
|
#14 | |
Senior Member
|
Quote:
Where should I define this field? I never do anything such it before. do I apply it to g file in constant directory? please explain it for me with more details. how can I calculating the vector by using points? at least I have 1 million points. a new problem is that my gravity is varying with depth!!!! it means that the gravity at 0.5R isn't equal to gravity at R!!!! What should I do???? again thank you niaz |
||
July 29, 2012, 19:22 |
|
#15 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
This isn't the first time I see someone asking about changing how gravity works in OpenFOAM. But after a quick search, I only found this to be relevant: http://www.cfd-online.com/Forums/ope...tml#post360969 post #23 That particular post has an implementation that might be a good source of information or at least idea on how to do what you're looking for. Good luck! Bruno
__________________
|
|
July 30, 2012, 03:51 |
|
#16 | |
Senior Member
|
Quote:
that was great, I got many ideas from it! all of posts were about time dependence of gravity, but my problem is varying it with depth. it is independent of time. how can I apply it? of course, after defining my gravity pattern!!!! because I have problems in defining a center-oriented gravity field yet! |
||
July 30, 2012, 04:23 |
|
#17 |
Senior Member
A_R
Join Date: Jun 2009
Posts: 122
Rep Power: 17 |
Dear adam
please look at your points in constant folder. your points are written in the form of (x y z). you need to drive a unit vector which I discuss in last post. |
|
July 30, 2012, 05:53 |
|
#18 | |
Senior Member
|
Quote:
this is a portion of points file: Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.0.1 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class vectorField; location "constant/polyMesh"; object points; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 43003 ( (-0.01847759065 0.007653668647 0) (-0.01779042759 0.007552721936 0.005143644393) (-0.01960468925 0.003159255628 0.002382281129) (0.007679387991 -0.006329673946 -0.01734826296) (0.01688526706 -0.01020474922 0.003278848865) (-0.01834319804 0.002810689581 0.007458358384) (-0.01584939034 0.006818828176 0.01011436642) (-0.01460689264 0.01135644457 0.007594067049) (-0.01592745136 0.01184211524 0.002465887277) (-0.01597723029 0.01167792986 -0.002890340183) (-0.01295887432 0.01522695429 -0.0004554552274) (-0.01220887115 0.01514557064 0.004642752982) (-0.01213174065 0.01012345964 0.01226117587) (-0.01034525646 0.01425080084 0.009481051856) (-0.01950515249 0.003259328014 -0.00298760896) (-0.01772160189 0.007511999119 -0.005432742923) (-0.01591634427 0.001975366477 0.01194855273) (-0.01287687011 0.005423605639 0.01430981195) (-0.01940682589 -0.001585931407 0.004567267278) (-0.01994415536 -0.00137345384 -0.0005867635026) (-0.01762641938 -0.001868149175 0.009263873847) (-0.009026652487 0.01777835472 0.001565135287) (-0.007606758639 0.01740382727 0.006264504705) (-0.00769419341 0.01248809659 0.01359583875) (-0.005493030072 0.01606271423 0.01057430056) (-0.008817764601 0.008133616155 0.01600285336) (-0.01261059616 0.0005972273644 0.01551180788) (-0.009091657511 0.003292598427 0.01750715737) (-0.01806927596 0.003124101276 -0.007983812223) (-0.0190956556 -0.001197339263 -0.005824286735) (-0.01901153672 -0.005970452141 0.001707387688) (-0.01888850544 -0.005639026881 -0.003380197942) (-0.01249883992 0.01462668367 -0.005462520073) . . . . thank you |
||
July 30, 2012, 06:33 |
|
#19 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
hi dear adam
as my friend niaz told you before, you need a unit vector. unit vector can be find like that: (r-r0)/|r-r0| which r is the position vector in each point and r0 is the position vector of your center, as i before said i guess you should define a volVectorField instead of dimensionedVector (Burno post give you the idea how to implement it), then you can define easily such a function with funkySetFields or groovyBC |
|
July 30, 2012, 06:44 |
|
#20 | |
Senior Member
|
Quote:
I hope that I can do it. I will be here soon!!!!! |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problems after decomposing for running | alessio.nz | OpenFOAM | 7 | March 5, 2021 05:49 |
Moving mesh | Niklas Wikstrom (Wikstrom) | OpenFOAM Running, Solving & CFD | 122 | June 15, 2014 07:20 |
Turbulence dampening due to magnetic field in LES and RAS | eelcovv | OpenFOAM | 0 | June 8, 2010 12:35 |
Zero size field | taranov | OpenFOAM Bugs | 2 | April 20, 2010 05:51 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 07:51 |