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

non-stationary scalarTransportFoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 23, 2012, 12:04
Default non-stationary scalarTransportFoam
  #1
Member
 
Join Date: Jul 2012
Posts: 31
Rep Power: 5
kpax is on a distinguished road
hi everyone,

i am trying to modify the scalarTransportFoam solver so that it can be applied to time-varying velocity fields (that i have computed with another solver).
My idea was to insert the following lines from createFields.H inside the main loop of scalarTransportFoam.C:

-------------------
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
# include "createPhi.H"
-------------------------------

i thought this would update the U-field for every time step. The U-fields in the respective folders are, however, all changed to the initial U-field ( /0/U).

Does anyone have an idea what's the problem here?

Thx in advance.
kpax is offline   Reply With Quote

Old   August 2, 2012, 08:52
Default
  #2
Member
 
Join Date: Jul 2012
Posts: 31
Rep Power: 5
kpax is on a distinguished road
anyone has an idea?!
kpax is offline   Reply With Quote

Old   August 2, 2012, 15:48
Default
  #3
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,488
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings kpax and welcome to the forum!

Perhaps you should think the other way around, namely use an existing solver as a basis for a non-stationary scalarTransportFoam. Better yet, you'll find at openfoamwiki.net the following two pages:
  1. http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam
  2. http://openfoamwiki.net/index.php/ScalarTransportFoam
If you compare the two articles, you'll see that the information from the second one is used in the first one!

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   August 3, 2012, 10:12
Default
  #4
Member
 
Join Date: Jul 2012
Posts: 31
Rep Power: 5
kpax is on a distinguished road
hey wyldckat,

the other way around works perfectly!

thx alot!
kpax is offline   Reply With Quote

Old   October 30, 2013, 17:59
Default
  #5
Member
 
Vishal Achasrya
Join Date: Nov 2011
Posts: 30
Rep Power: 5
vishalsacharya is on a distinguished road
Hi,

But if icoFoam is used and a scalar transport is added to it, then both velocity and T would be solved for simultaneously coupled.
What if I want to use scalarTransportFoam, but instead have a time-varying velocity field that is not solved but prescribed by the user?
For example, what if my velocity is such that u=A+B*cos(t) and I want to use this time-varying field as the velocity with scalarTransportFoam, then how is this done?
vishalsacharya is offline   Reply With Quote

Old   November 1, 2013, 20:12
Default
  #6
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,488
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Greetings Vishal,

Quote:
Originally Posted by vishalsacharya View Post
But if icoFoam is used and a scalar transport is added to it, then both velocity and T would be solved for simultaneously coupled.
I might be wrong, but my interpretation is that the scalar transport of the passive scalar T is completely segregated!
One example of coupled vs segregated flow: http://www.cfd-online.com/Wiki/Fluen...ated_solver.3F

Quote:
Originally Posted by vishalsacharya View Post
What if I want to use scalarTransportFoam, but instead have a time-varying velocity field that is not solved but prescribed by the user?
For example, what if my velocity is such that u=A+B*cos(t) and I want to use this time-varying field as the velocity with scalarTransportFoam, then how is this done?
Uhm... with funkySetFields you can set the U field and then simply run scalarTransportFoam? http://openfoamwiki.net/index.php/Co...funkySetFields

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   November 5, 2013, 13:01
Default
  #7
Member
 
Vishal Achasrya
Join Date: Nov 2011
Posts: 30
Rep Power: 5
vishalsacharya is on a distinguished road
Bruno,

Thanks for the reply.
Indeed, for a passive scalar, the U and T are independent. However what I have is a case where my U is a function of space and time and I have a mathematical form for it such as A+B*cos(t). I wanted to hard-code this into the solver.

I looked at the code and U (and phi) are defined in createFields.H before the simple.loop(). Which means that the default scalarTransport can only use a U that is defined at the beginning and kept the same throughout. I changed this by removed the block of code from "volVectorField U ( " until #include "createPhi.H" and included it in my simple.loop().
But since I am not reading or writing U to a file, I need not define U as an IOobject. Instead, I need to have a loop over all cells that calculates U as A(x,y)+B(x,y)*cos(t).

If I use the following inside the simple.loop():

volVectorField U = (U0+uamp*sin(2.0*pi*f0*runTime))*vector(1, 0, 0) + (V0+vamp*sin(2.0*pi*f0*runTime))*vector(0, 1, 0);

It does not work !
Here, U0, uamp, V0 and vamp are dimensionedScalars that have units m/s and f0 is a dimensionedScalar with unit 1/s, runTime is the time value I have used, pi is a const scalar. All of these values are read from the transportProperties dictionary file in the createFields.H file.
vishalsacharya is offline   Reply With Quote

Old   November 23, 2013, 06:19
Default
  #8
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,488
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Vishal,

I've finally managed to get some time and clear mind to look into your post.

The first thing that comes to mind is potentialFoam: http://openfoamwiki.net/index.php/PotentialFoam - this solver is as simple or simpler than scalarTransportFoam and allows for you to do tests of modifying "U" more easily with this solver.

The second thing that comes to mind: can you please share the source code of the modified solver you're working on? This way I could test for myself and figure out what's wrong/missing.

Best regards,
Bruno
wyldckat is offline   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
ScalarTransportFoam for RTD calculations santoo_cfd OpenFOAM Running, Solving & CFD 34 May 22, 2014 10:20
Can CFX do CHT simulations with a solid domain rotating in a stationary fluid domain? acro CFX 8 July 8, 2013 08:11
Problem with scalarTransportFoam illistrated using pitzDaily tutorial mlawson OpenFOAM 2 January 18, 2011 14:39
Stationary Vs. Moving Mesh startingcfd Main CFD Forum 1 July 18, 2010 11:05
How to output data from stationary part only? Aerolex FLUENT 0 November 16, 2009 23:46


All times are GMT -4. The time now is 05:22.