Defining convergent center-oriented gravity field! please Help me
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 |
what is "convergent gravity field"?
|
1 Attachment(s)
Quote:
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 |
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" |
Quote:
I will test it. |
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. |
Quote:
just now I'm trying!!!!!!!! thank you |
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 |
Dear mahmoud
do you use blockmesh. if yes, send me your case to describe you |
Quote:
No, I create it with Gambit (.msh) and I've used fluent3DMeshToFoam. have you any idea??? Thank you Mostafa Mahmoudi |
if you can please show it in the site for better understanding
|
1 Attachment(s)
Quote:
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 |
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 |
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 |
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 |
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! |
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. |
Quote:
this is a portion of points file: Code:
/*--------------------------------*- C++ -*----------------------------------*\ thank you |
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 |
Quote:
I hope that I can do it. I will be here soon!!!!! ;) |
hi Nima,
I'm pretty a new user of OF in compare with you, can you explain me how can I define the position vector? where should I define it? I'm using the buoyantBoussinesqSimpleFoam. should I remove the g file in constant directory? can you attach me an example? actually I know what to do but I cannot Implement it in OpenFOAM!!!!!!! please help me, I'm so confused. thank you |
hi newbie :D
do you know how to implement a code at OpenFOAM at all? 1) first read user guide chapter 3 if i was true :D, it tells you how to compile a code 2) read programmer guide, it has 2,3 example how to implement a code 3) you can find some tutorials about how to add a source term to a solver or how to add energy equation into a solver in Internet. it gives you enough information how to start 4)the last but not the least ;), if you live in Iran/Tehran you can attend at ISME OpenFOAM workshop, hold by myself, i teach these things there |
Quote:
Thank you for your reply. again I rummage the user guide and programmer's guide, but I catch anything. there wasn't any example or hint for defining a position vector. till now I just change the geometry of OF examples and I've applied only small change in codes. I didn't implement a code myself, I just changed them. unfortunately, I don't live in Tehran, I'm a bachelor student of Shahrood university of technology and now I'm at Torbat-e Heydariyeh. can you help me that how and where can I define a position vector? if I define it, it is possible to change the g. of course, I'm trying to define this vector by chance!!!! I hope I can do it Thank you |
i suppose you know how to change a code :D
you need define a volVectorField g (do you know, how?, look at code and see how velocity is implemented) then you need to access position vector: poistion vector can be accessed by: U.mesh.C() and you need to read the center position vector from dictionary (see how gravity vector is implemented) i know, you know the rest, you should implement the function i mentioned in previous post. Thats it! |
Quote:
I'm trying and some advances were made!!!! I promise if I couldn't solve this problem, again I will be back ;):D |
All times are GMT -4. The time now is 20:09. |