CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Is it possible add a passive scalar to an already finished simulation?

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

Like Tree5Likes
  • 1 Post By anon_q
  • 3 Post By francescomarra
  • 1 Post By francescomarra

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 29, 2018, 15:00
Default Is it possible add a passive scalar to an already finished simulation?
  #1
Senior Member
 
Join Date: Mar 2018
Posts: 115
Rep Power: 8
anon_q is on a distinguished road
I conducted a simulation in OpenFOAM of a flow over a cylinder. Now the simulation is finished. So I am in the step of postprocessing of the simulation and I decided to add a passive scalar to the domain. Can I solve for the passive scalar without restarting the simulation?

Any ideas?
zhangyan likes this.
anon_q is offline   Reply With Quote

Old   March 30, 2018, 05:15
Default
  #2
Member
 
Franco Marra
Join Date: Mar 2009
Location: Napoli - Italy
Posts: 68
Rep Power: 17
francescomarra is on a distinguished road
Dear Evren Linda,

if I correctly understood your question, this is one of the exercise I do in my course for my students.
It is rather simple. I start with a simulation of the lid driven cavity, the main OpenFoam tutorial you find in the user guide. When the solution is fully evolved and steady state reached, I have the velocity field corresponding to a vortex in the box.
You can collect this velocity field and use it as a prescribed field in the simulation of the passive scalar. Of course you need to preserve the geometry of your case (maybe this is not strictly necessary, if you project this solution onto another mesh, but strange behaviors can arise).
What I do is simply to create another case, for instance starting from tutorial
$FOAM_TUTORIALS/basic/scalarTransportFoam/pitzDaily
where variable T is a passive scalar, and then replace geometry (blochMeshDict) with your geometry description and 0/U with the velocity field you like to use (by copying, say, yourcase/endtime/U in place of 0/U).
An update of the boundary conditions of 0/T for the new geometry et voilà, you can have your passive scalar evolution.
The possibility to reuse all fields in OpenFoam is one of the wonders I really like of this software.

Feel free to contact me again if something is not clear.

Good scalar Easter Eggs !

Franco
excolade, anon_q and reverseila like this.
francescomarra is offline   Reply With Quote

Old   March 30, 2018, 11:20
Default
  #3
Senior Member
 
Join Date: Mar 2018
Posts: 115
Rep Power: 8
anon_q is on a distinguished road
Thank your very much dear Franco. If I really understand your answer, then I have to setup a case for scalarTransportFoam (say, named 'transportCase') and I have to replace the geometry (transport/constant/polyMesh) with my original case's polyMesh (cylinderCase/constant/polyMesh) and use cylinderCase's final solution as initial condition for transportCase. After doing that, that will solve for passive scalar only for the last time step(final solution of cylinderCase), so how can I solve for the entire time range? Do I need to setup transportCase for each time step of cylinderCase?
anon_q is offline   Reply With Quote

Old   March 30, 2018, 12:03
Default
  #4
Member
 
Franco Marra
Join Date: Mar 2009
Location: Napoli - Italy
Posts: 68
Rep Power: 17
francescomarra is on a distinguished road
Dear Evren Linda,
I do not know your case. What I explained is valid for a steady case. This means that the new simulation "transportCase" will assume the flow field constant in time, solving only the transport of the scalar with this constant velocity field.
If your flow is not steady, I am afraid it is almost impossible to solve a scalar transport without coupling it with the flow simulation: even if you would use all the saved time steps of your simulation, this will not be sufficient to get an equally accurate simulation of the transported scalar (at least in the case you did not save every computed time step).
If your flow field reaches a steady state, you can use the last velocity field to initialize a simulation in time that only transport the scalar. scalarTransportFoam does not update the velocity field but use it to continuously update the position of the transported scalar. You can run it as long in time as required.
Of course you need to setup initial (and boundary) conditions for your scalar variable.

Regards,
Franco
anon_q likes this.
francescomarra is offline   Reply With Quote

Old   March 30, 2018, 14:46
Default
  #5
Senior Member
 
Join Date: Mar 2018
Posts: 115
Rep Power: 8
anon_q is on a distinguished road
Dear Franco thank you very much for your explanation. Now I understand well how things really work. I have a transient simulation so I need to restart it accordingly to account for the passive scalar. I can change pimpleFoam solver by adding the passive scalar transport equation, that works fine. But I believe, OpenFOAM solvers may have some features to allow adding such things without modifying the solver's code but unfortunately I do not know how. (I guess by adding something to controlDict)
Can you please tell me how to setup a case (say for pimpleFoam) that will solve for a passive scalar? I would really appreciate your help.

Last edited by anon_q; March 30, 2018 at 14:50. Reason: Fixing some typos
anon_q is offline   Reply With Quote

Old   March 30, 2018, 14:53
Default
  #6
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
If you want to use OF out of the box you may switch between pimpleFoam and scalartransportFoam. So you get a quasi transient solution for your scalar. It is need more computer power of course, but not in any case thayt is a problem.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   March 30, 2018, 17:14
Default
  #7
Senior Member
 
Join Date: Mar 2018
Posts: 115
Rep Power: 8
anon_q is on a distinguished road
Hello Uwe,
I can't really understand what do you mean. Do you mean to start scalarTransportFoam for each time step of pimpleFoam?
anon_q is offline   Reply With Quote

Old   March 31, 2018, 00:49
Default
  #8
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
Quote:
Originally Posted by Evren Linda View Post
Hello Uwe,
I can't really understand what do you mean. Do you mean to start scalarTransportFoam for each time step of pimpleFoam?
In principle. Of course not for every time step but for a time step small enough to cover the transient part of the flow.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   April 3, 2018, 03:06
Default
  #9
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 638
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi,

Check this explanation on the scalar transport functionObject.

This allows you to solve for a passive scalar in any solver that works with function objects.

Regards,
Tom
tomf is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passive scalar is diffusive without mesh motion Tobi OpenFOAM Running, Solving & CFD 6 August 5, 2015 09:51
compressible flow in turbocharger riesotto OpenFOAM 50 May 26, 2014 01:47
Solving passive scalar in a Multiphase field zcjwyl OpenFOAM Running, Solving & CFD 0 April 30, 2012 10:59
Add passive scalar temperature equation to the Channelflow YANGLIANG OpenFOAM Running, Solving & CFD 1 March 9, 2010 05:23
Passive Scalar Andy R FLUENT 0 January 10, 2007 14:49


All times are GMT -4. The time now is 07:48.