CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Initialization in scalarTransport

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   August 22, 2008, 15:23
Default Hi All, How do I initialize
  #1
Senior Member
 
Senthil Kabilan
Join Date: Mar 2009
Posts: 113
Rep Power: 8
skabilan is on a distinguished road
Hi All,

How do I initialize a problem where T is a field, not a single value at the boundary in case of scalarTranportfoam?

Thanks
Senthil
skabilan is offline   Reply With Quote

Old   August 22, 2008, 16:38
Default Hi Senthil, I usually get a r
  #2
Member
 
M. Mahdi Salehi
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 50
Rep Power: 8
smehdi609 is on a distinguished road
Hi Senthil,
I usually get a reference to the scalar field and initialize it. In this way you have to change the application and recompile it.
You can also use funkySetFields utility. You can find information about it in forum and wiki. I have never used it.
Cheers,
Mahdi
smehdi609 is offline   Reply With Quote

Old   August 22, 2008, 17:26
Default Hi Mahdi, Thanks for your v
  #3
Senior Member
 
Senthil Kabilan
Join Date: Mar 2009
Posts: 113
Rep Power: 8
skabilan is on a distinguished road
Hi Mahdi,

Thanks for your valuable input. I need some more help with the reference to scalar field. How can I go about doing that? Is there an example that you can share with me?

Thanks in advance
Senthil
skabilan is offline   Reply With Quote

Old   August 22, 2008, 18:27
Default Hi Senthil If the distribut
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,565
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
Hi Senthil

If the distribution can be given in some algebraic way as a function of location, then I suggest that you go for the funkySetField application.

See the following thread for information/inspiration :

http://www.cfd-online.com/OpenFOAM_D...es/1/6821.html

There is also a wiki, but I have problems connecting to it, but I believe the link is in the above thread.

Have fun,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   August 22, 2008, 19:43
Default Hi Senthil, It's pretty simpl
  #5
Member
 
M. Mahdi Salehi
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 50
Rep Power: 8
smehdi609 is on a distinguished road
Hi Senthil,
It's pretty simple. Let's say you have a scalar field T and you want to initialize it with a parabolic function of y; you may write:

volScalarField yPos = mesh.C().component(vector::Y);
forAll(T, counter)
{
T[counter] = yPos[counter]*(1.0 - yPos[counter]);
}

This is just for the internal field. If you also want to initialize the boudaries as well, let's say you have a boundary patch named inlet, you may write:

label inletPatchID = mesh.boundaryMesh().findPatchID("inlet");
fvPatchScalarField& inletT = T.boundaryField()[inletPatchID];
const vectorField& faceCentresInlet = mesh.Cf().boundaryField()[inletPatchID];
forAll(inletT, pointI)
{
inletT[pointI] = faceCentresInlet[pointI].y()*(1.0 - faceCentresInlet[pointI].y());
}
This is the way I do it, because I usually write my own applications and rarely have complex initial conditions. If you want to do it very often, I think it's better to use funkySetField application.
Cheers,
Mahdi
smehdi609 is offline   Reply With Quote

Old   August 25, 2008, 01:23
Default Hi All, To make it a bit mo
  #6
Senior Member
 
Senthil Kabilan
Join Date: Mar 2009
Posts: 113
Rep Power: 8
skabilan is on a distinguished road
Hi All,

To make it a bit more clearer, I have attached a acrobat file which explains what I would like to do with the scalarTransportFoam. \attach

Thanks all in advance for your never ending help!

Cheers,
Senthil
skabilan is offline   Reply With Quote

Old   August 25, 2008, 01:25
Default My bad! Thanks Senthil
  #7
Senior Member
 
Senthil Kabilan
Join Date: Mar 2009
Posts: 113
Rep Power: 8
skabilan is on a distinguished road
My bad!

Thanks
Senthil
skabilan is offline   Reply With Quote

Old   August 25, 2008, 01:41
Default Sorry for a lot of messages. T
  #8
Senior Member
 
Senthil Kabilan
Join Date: Mar 2009
Posts: 113
Rep Power: 8
skabilan is on a distinguished road
Sorry for a lot of messages. The file size was big

I have a complex temperature field (Figure 1). For the sake of argument, let us say it is defined by experiment and therefore is not expressible as a simple function of X, Y or Z

In my application, I need to solve for the time-dependent movement of the temperature thought the geometry, as a function of self-diffusion and convection. Previously, I have solved (not in OF) the diffusion equation of this field (Figure 2).

I also have from a previous run of OF, the separate solution of the incompressible Navier-
Stokes equation. My problem is to use the pre-defined velocity field and now
diffuse AND convect the temperature field. ScalarTransportFOAM has the right physics.
My question is how do I initialize the problem. It almost seems like a 'restart'. Note the
problem is decoupled in the sense that the velocity will influence (convect) the
temperature field, but the temperature field has NO influence on the velocities.
skabilan is offline   Reply With Quote

Old   August 25, 2008, 10:45
Default Hello Senthil, >let us say
  #9
nadine
Guest
 
Posts: n/a
Hello Senthil,

>let us say it is defined by experiment and therefore is not expressible as a simple function of X, Y or Z

You'll probably have to find an interpolation of your measured (or simulated) data as a function of X,Y,Z. Just having a "complex temperature field" without any mesh and without other structure gets you nowhere.

>It almost seems like a 'restart'

It *is* a restart. Write your temperature field as initial conditions into the file yourcase/0/T and run.

Nadine
  Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
initialization kunal FLUENT 5 April 17, 2008 22:45
Initialization - VOF moas FLUENT 4 February 19, 2008 23:35
DPM Initialization Johannes FLUENT 1 June 20, 2007 09:27
initialization alfa FLUENT 0 March 19, 2006 11:26
Initialization of VOF Jennie Main CFD Forum 4 November 18, 1999 17:41


All times are GMT -4. The time now is 13:49.