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

Runtime changing of bondary conditions

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By evrikon
  • 1 Post By leonardo.morita
  • 1 Post By mskarysz

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 4, 2009, 06:33
Default Runtime changing of bondary conditions
  #1
New Member
 
Oleksiy Kurenkov
Join Date: Mar 2009
Location: Nueremberg
Posts: 16
Rep Power: 17
evrikon is on a distinguished road
Send a message via Skype™ to evrikon
Hello together,

Sometimes I would like to change the boundary condition on-the-fly during the iterations. There is a situation for example where I've recognised to make a small mistake in b.c., however the flow field is nearly correct and good converged.
The option "runtimeModificable" in system dictionary belongs only to numerical settings, like solvers, schemes etc. Any changing of files in "0" directory does not affect the current calculation.

The only option what I see is the solution mapping. Is there any other option (may be simpler) what I don't see now?
sfernaferna likes this.
__________________
*************************
Cheers, Oleksiy
evrikon is offline   Reply With Quote

Old   June 4, 2009, 07:02
Default
  #2
Member
 
Leonardo Giampani Morita
Join Date: Apr 2009
Location: Paris, France
Posts: 58
Rep Power: 17
leonardo.morita is on a distinguished road
Hello,

A simple way to do that is just to stop your simulation, imposing at the controlDict 'stopAt writeNow', and then you can change the BC in the last time folder created. To restart your simulation, you chose 'startFrom latestTime'.
Note that BC are not read from these files during the calculations, but only at the beginning, so changing them on the fly will have no effect (somebody correct me if I'm wrong).

Regards,

Leonardo
miotto likes this.
leonardo.morita is offline   Reply With Quote

Old   November 24, 2009, 19:53
Default
  #3
Member
 
Join Date: Mar 2009
Location: Sydney, New South Wales, Australia
Posts: 42
Rep Power: 17
rassilon is on a distinguished road
Quote:
Originally Posted by leonardo.morita View Post
Hello,

A simple way to do that is just to stop your simulation, imposing at the controlDict 'stopAt writeNow', and then you can change the BC in the last time folder created. To restart your simulation, you chose 'startFrom latestTime'.
Note that BC are not read from these files during the calculations, but only at the beginning, so changing them on the fly will have no effect (somebody correct me if I'm wrong).

Regards,

Leonardo

Hi Guys,

How did you get on with the runtime changing of boundary conditions?

I am running a model that I need to switch the boundary condition from an inletOutlet to a Wall after 1.5 seconds, and then continue to convergence as a wall.

I have tried using the mapFields technique, but it doesn't seem to work - the finished model just displays garbage in Paraview when I run it.

Is there any way of altering the boundary conditions in the middle of the run, or alternatively stopping the run, changing the conditions by hand and then re-starting it?

I think I will be really stuck if I can't get this to work...


R
rassilon is offline   Reply With Quote

Old   December 8, 2017, 03:41
Default
  #4
Member
 
Chris Schäfer
Join Date: Apr 2017
Posts: 34
Rep Power: 9
Chris123 is on a distinguished road
Quote:
Originally Posted by leonardo.morita View Post
Hello,

A simple way to do that is just to stop your simulation, imposing at the controlDict 'stopAt writeNow', and then you can change the BC in the last time folder created. To restart your simulation, you chose 'startFrom latestTime'.
Note that BC are not read from these files during the calculations, but only at the beginning, so changing them on the fly will have no effect (somebody correct me if I'm wrong).

Regards,

Leonardo
Sorry for revitalize this thread again, but I'am also tackle this problem to change the BC on the fly. If I do it as Leonardo said, I got the error message of inconsistent patch and patchfield types between sthe old and the new BC entries in my U file. Any further ideas?
Best regards,
Chris
Chris123 is offline   Reply With Quote

Old   December 12, 2017, 11:41
Default
  #5
New Member
 
Maciej Skarysz
Join Date: Mar 2016
Posts: 6
Rep Power: 10
mskarysz is on a distinguished road
The answer is here:
How to change fvPatchField type of volume Field

You can do it by 'set' function:
Code:
a.boundaryField().set(patchi, fvPatchField<scalar>::New(name, mesh.boundary()[patchi], a));
where, 'a' is your scalar field, 'patchi' is label of your patch, and name is your new boudary type name, e.g. "zeroGradient". In OF5 you should use:
Code:
boundaryFieldRef()
Here is an example:
Code:
U.boundaryFieldRef().set(0,fvPatchField<vector>::New("zeroGradient", mesh.boundary()[0], U));
Regards
Michael@UW likes this.
mskarysz is offline   Reply With Quote

Reply


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
UnSteady Boundary Conditions - Changing with time Docker FLUENT 4 July 14, 2011 11:01
changing the boundary conditions values gerado OpenFOAM 3 April 30, 2009 08:28
changing value of boundary conditions zjbwow FLUENT 2 March 25, 2009 03:56
How to apply bondary conditions only having mesh. mitul CFX 1 February 10, 2007 04:28
Problem of changing boundary conditions fredfuyou FLUENT 1 May 14, 2002 11:50


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