CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Changing Boundary Conditions during processing (http://www.cfd-online.com/Forums/openfoam-solving/70220-changing-boundary-conditions-during-processing.html)

rassilon November 17, 2009 19:06

Changing Boundary Conditions during processing
 
Hi Folks,

I need to arrange to change the boundary condition from an inletOutlet to a Wall during the simulation run.

My run is 10 seconds long, and for the first 1.5 seconds, the BC must function as an InletOutlet, reading in pressure values from an external file. However after 1.5 seconds, I need the BC to change to a Wall and allow no mass transfer through the BC for the remainder of the run.

How do I do this? I have tried running the model with the inletOutlet condition, stopping it, editing the BC, then using the mapFields -consistent command to attempt to restart the simulation from the last iteration, however this just produces nonsense when I post process the run.

Is there something I am missing? Any help would be greatly appreciated - this is the last hurdle to getting this particular model running smoothly.

Cheers,


R

rassilon November 24, 2009 20:33

Quote:

Originally Posted by rassilon (Post 236681)
Hi Folks,

I need to arrange to change the boundary condition from an inletOutlet to a Wall during the simulation run.

My run is 10 seconds long, and for the first 1.5 seconds, the BC must function as an InletOutlet, reading in pressure values from an external file. However after 1.5 seconds, I need the BC to change to a Wall and allow no mass transfer through the BC for the remainder of the run.

How do I do this? I have tried running the model with the inletOutlet condition, stopping it, editing the BC, then using the mapFields -consistent command to attempt to restart the simulation from the last iteration, however this just produces nonsense when I post process the run.

Is there something I am missing? Any help would be greatly appreciated - this is the last hurdle to getting this particular model running smoothly.

Cheers,


R


Apologies for shamelessly bumping this thread - Is there anybody out there that has any ideas about how to switch the boundary condition during the simulation?

Cheers,


R

jackmarlowe February 8, 2010 04:52

Changing Boundary Conditions during processing
 
Hi rassilon,
I need to find an answer to your question too, I'd be happy if you inform me about any progress you had about it.

This question is of great significance since it skips over a laborious procedure such dynamic mesh construction, I think it is a brilliant idea to change the BC type in a transient, simple/prompt analysis.

I read Fluent 6.3 user guides about this subject and the closest application I found is the use of programs called WAVE and GT-Power, in which it is claimed that BC's can be modified in a transient analysis. If anyone has any experiance about them, it would be great if they share their knowledge about them.

It seems we've to write UDF's, but I am not yet comfortable with them.
In the future I would even request the modification of BC's depending on some internal data from inside the solution domain during the transient analysis, but I guess it can wait for now.

rassilon February 8, 2010 19:04

Quote:

Originally Posted by jackmarlowe (Post 245311)
Hi rassilon,
I need to find an answer to your question too, I'd be happy if you inform me about any progress you had about it.

This question is of great significance since it skips over a laborious procedure such dynamic mesh construction, I think it is a brilliant idea to change the BC type in a transient, simple/prompt analysis.

I read Fluent 6.3 user guides about this subject and the closest application I found is the use of programs called WAVE and GT-Power, in which it is claimed that BC's can be modified in a transient analysis. If anyone has any experiance about them, it would be great if they share their knowledge about them.

It seems we've to write UDF's, but I am not yet comfortable with them.
In the future I would even request the modification of BC's depending on some internal data from inside the solution domain during the transient analysis, but I guess it can wait for now.


Hi Jack,

I have had a good pointer as to how to get it off of the ground, but am really struggling to get it implemented at the moment.

Essentially, by using a re-written mixed boundary condition we can achieve switching from one condition type - say inlet - to another - say a wall - at a specified time or when a specific condition is met.

It has been suggested that by utilising an if-then-else procedure in the boundary condition code, then switching can be achieved. So for my case, it should look something like this:

IF time <= 1.5 seconds, THEN boundary condition = inletOutlet
ELSE boundary condition = wall

For an experienced programmer, it should be a reasonably simple task to get this going.

Unfortunately, I am not a programmer by trade, and I am getting very swamped in the code for the boundary condition. At a basic level, I have tried simply copying and renaming the boundary condition and recompiling that, but am getting loads of errors at compile time.

If you have had any experience of re-writing boundary conditions, I would love to hear it!


R

gwierink February 9, 2010 06:52

Hi guys,

Have a look at groovyBC, a utility for mixed boundary conditions. In Contrib groovyBC you can find details and examples.

rassilon February 9, 2010 20:46

Quote:

Originally Posted by gwierink (Post 245461)
Hi guys,

Have a look at groovyBC, a utility for mixed boundary conditions. In Contrib groovyBC you can find details and examples.


I've had a good look at groovyBC in the past, but don't think that I can utilise it in my particular problem at the moment, though I may be able to do so later on, as in the fullness of time I would like to be able to read in a pressure function as opposed to a time file data set.

At the moment I need a a multiphase solver with a boundary condition that can be switched from one state to another at a specific point in time, where the time data is read in from a file.

Using the interFoam solver, I am attempting to modify the timeVaryingUniformFixedValue boundary condition (I have successfully got this working to read in time data from an external file) to perform my switching function.

I think I could really benefit from an idiots guide to writing my own Boundary Functions...


R

jackmarlowe February 11, 2010 03:51

Changing Boundary Conditions during processing
 
Thank you for the suggestion gwierink. It looks useful but I'd like to try Fluent's own functions without downloading extra software.
In Fluent 6.3 Udf Manual I came cross to this example about setting up mass flow rate for user determined time intervals (Pdf page 113). It may work for my case. To simulate the wall condition, I am going to try setting
mass flow rate = 0 for some t.
I hope Fluent do not restrict the choice of inlet (or outlet) BC type preference while one BC is set this way.
I can not try this right now (I am away from my computer) but as soon as I get any result, I will share it here.

Regards,
M.

NickG April 29, 2010 12:52

Hi guys

Have you had any luck? I have a similar problem in that I want a boundary condition on a revolving cylinder to change between inlet and outlet depending upon a points position relative to the stationary frame. I looked at groovyBC but, although I didn't try it I thought it was for varying the parameters of a single type rather than varying types.

What have you found out?

Cheers Nick

NickG April 29, 2010 12:54

There's a basic how to write your own boundary condition here: http://openfoamwiki.net/index.php/Ho...dary_condition

N

gwierink April 30, 2010 04:22

Hi Nick,

Quote:

I looked at groovyBC but, although I didn't try it I thought it was for varying the parameters of a single type rather than varying types.
Is it perhaps an idea to switch the face/patch normal between positive and negative velocity at the inlet/outlet depending on revolution time (rather than position)?

NickG April 30, 2010 05:27

Hi Gijs

Thanks for the idea. Unfortunately I want a constant input from one side (from a stationary point of view) and an outlet on the other at the same time as the cylinder rotates so I don't a time dependent solution will work as such. However it opens up a method I hadn't thought of... Thanks

Nick


All times are GMT -4. The time now is 00:39.