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

mapped boundary condition

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

Like Tree13Likes
  • 7 Post By latvietis
  • 5 Post By Linse
  • 1 Post By randolph

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 10, 2012, 08:03
Default mapped boundary condition
  #1
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 519
Rep Power: 15
samiam1000 is on a distinguished road
Dear Foamers,

what about the mapped BC? How can I set them? Where can I find an example? Do you think they are good for fixing the patch where I do have 2 different fluid regions?

Thanks a lot,
Samuele.
samiam1000 is offline   Reply With Quote

Old   May 14, 2012, 23:19
Default
  #2
Member
 
Martin
Join Date: Dec 2011
Location: Latvia
Posts: 54
Rep Power: 10
latvietis is on a distinguished road
I'm actually also looking for some kind of tutorial/example. Any luck finding one?

Martin
latvietis is offline   Reply With Quote

Old   May 15, 2012, 03:45
Default
  #3
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 519
Rep Power: 15
samiam1000 is on a distinguished road
Hi Martin,

if you agree we can collaborate in order to get something useful.

Please, write me an email and we'll discuss the problem (if you want, of course): samuele.zampini@gmail.com

Have a good day,
Samuele
samiam1000 is offline   Reply With Quote

Old   May 21, 2012, 07:39
Default
  #4
Member
 
Martin
Join Date: Dec 2011
Location: Latvia
Posts: 54
Rep Power: 10
latvietis is on a distinguished road
Greetings!

I actually found solution to my problem. Maybe this will give some hint where to start looking.

Firstly, I did search in OpenFOAM tutorials and

Code:
openfoam210/tutorials/incompressible/pisoFoam/les/pitzDailyMapped
was my starting point.

Then read .H file, that gives some basic knowladge http://foam.sourceforge.net/docs/cpp/a05692_source.htmlAlso, did a little search in forums and in the end I came up with revelation that it isn't that difficult. So, what worked for me was that I had to edit only 2 files - boundary and field file.

I opened "constant/polyMesh/bounadry"

Code:
    
patch1
    {
        type            patch;
        nFaces          3044;
        startFace       2260730;
    }
and edited it to

Code:
    patch1
    {
        type            mappedPatch;
        nFaces          3044;
        startFace       2260730;
        sampleMode      nearestPatchFace;
        samplePatch     patch1a;
        offsetMode      uniform;
        offset          (0 0 0);
    }
then went to "0/field_I_want_to_map"

Code:
    patch1
    {
        type                fixedValue;
        value               uniform (0 0 0);
    }
and edited to

Code:
    patch1
    {
        type                mapped;
        value               uniform (0 0 0);
        interpolationScheme cell;
        setAverage          false;
        average             (0 0 0);
    }
and it worked. At least I believe it did. I still have questions to all Foamers out there since there are things I want to understand to be sure about the result I achieved.

1) What is the meaning of 'offset'?

Code:
        offsetMode      uniform;
        offset          (0 0 0);
2) What is the meaning of 'averaging' something?

Code:
        setAverage          false;
        average             (0 0 0);
Yours,
Martin
latvietis is offline   Reply With Quote

Old   May 30, 2012, 07:36
Default
  #5
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Heilbronn
Posts: 183
Blog Entries: 1
Rep Power: 12
Linse is on a distinguished road
Concerning the "offset":
If I am not totally mistaken on this, "offset" gives the distance from the actual boundary where the mapping get's its data.
So if there is boundary A set with an offset of 0.001 it will get the value to map from B in a distance of 0.001 from A. If you set offset to -0.5, A will get the value from C 0.5 upstream of A.

C----(0.5)-------A-(0.001)-B

In case I am wrong on that, please anybody correct me!

For the average thing I do have many speculations, but nothing I would write in here....
Linse is offline   Reply With Quote

Old   July 14, 2016, 08:57
Default
  #6
Member
 
Join Date: Apr 2016
Posts: 79
Rep Power: 6
CellZone is on a distinguished road
Quote:

Code:
nFaces          3044; startFace       2260730;
Do I always have to lookup after doing snappyHexMesh under "polymesh/boundary" what mit startFace is and the number of nFaces? Isn't there a way to insert it automatically?

Thank you guys!
CellZone is offline   Reply With Quote

Old   February 10, 2019, 15:54
Default
  #7
Senior Member
 
Reviewer #2
Join Date: Jul 2015
Location: Gainesville,FL
Posts: 113
Rep Power: 7
randolph is on a distinguished road
Quote:
Originally Posted by latvietis View Post

2) What is the meaning of 'averaging' something?
Here is the code that associated with the setAverage

Code:
   if (setAverage_)
    {
        Type averagePsi =
            gSum(this->patch().magSf()*newValues)
           /gSum(this->patch().magSf());

        if (mag(averagePsi)/mag(average_) > 0.5)
        {
            newValues *= mag(average_)/mag(averagePsi);
        }
        else
        {
            newValues += (average_ - averagePsi);
        }
    }

    this->operator==(newValues);
So the setAverage is providing the constraints/BC on the mapped value by scaling. If your flow periodicity is well established, then turning off the setAverage should make no difference.
beatlejuice likes this.
randolph is offline   Reply With Quote

Old   July 6, 2020, 19:57
Default
  #8
Senior Member
 
Reviewer #2
Join Date: Jul 2015
Location: Gainesville,FL
Posts: 113
Rep Power: 7
randolph is on a distinguished road
Quote:
Originally Posted by randolph View Post
Here is the code that associated with the setAverage

Code:
   if (setAverage_)
    {
        Type averagePsi =
            gSum(this->patch().magSf()*newValues)
           /gSum(this->patch().magSf());

        if (mag(averagePsi)/mag(average_) > 0.5)
        {
            newValues *= mag(average_)/mag(averagePsi);
        }
        else
        {
            newValues += (average_ - averagePsi);
        }
    }

    this->operator==(newValues);
So the setAverage is providing the constraints/BC on the mapped value by scaling. If your flow periodicity is well established, then turning off the setAverage should make no difference.
"If your flow periodicity is well established, then turning off the setAverage should make no difference."

This statement is erroneous, my apology. If you are using the mapped BC as recycling BC for generating turbulence flow in LES, you need to rescale your velocity to keep the same mean bulk velocity.
randolph is offline   Reply With Quote

Old   September 17, 2020, 10:47
Default
  #9
New Member
 
Ran Yi
Join Date: May 2019
Posts: 7
Rep Power: 3
lizzy is on a distinguished road
Quote:
Originally Posted by randolph View Post
If you are using the mapped BC as recycling BC for generating turbulence flow in LES, you need to rescale your velocity to keep the same mean bulk velocity.
By this clarification, do you mean that if I run an LES case to generate a fully developed turbulence flow by mapped BC at the inlet, it is necessary to turn on the setAverage switch? That is to say, if the setAverage value is false, the velocity will decrease to zero with time marching because of the friction force?

Many thanks for your kind interpolation!

Regards,
Ran
lizzy is offline   Reply With Quote

Old   September 17, 2020, 10:51
Default
  #10
Senior Member
 
Reviewer #2
Join Date: Jul 2015
Location: Gainesville,FL
Posts: 113
Rep Power: 7
randolph is on a distinguished road
Quote:
Originally Posted by lizzy View Post
By this clarification, do you mean that if I run an LES case to generate a fully developed turbulence flow by mapped BC at the inlet, it is necessary to turn on the setAverage switch? That is to say, if the setAverage value is false, the velocity will decrease to zero with time marching because of the friction force?

Many thanks for your kind interpolation!

Regards,
Ran
Rand

Correct. Also, make sure your recycling length is long enough to allow the turbulence statistics decorrelated.

Thanks,
Rdf
randolph is offline   Reply With Quote

Old   September 17, 2020, 11:14
Default
  #11
New Member
 
Ran Yi
Join Date: May 2019
Posts: 7
Rep Power: 3
lizzy is on a distinguished road
Hi Rdf,
I just ran a ring pipe with LES (smagorinsky model) with the recycling mapped method to generate a fully developed turbulence flow as the beginning at a chamber. The recycling length is set as 3*D_out, and the setAverage has been set as true.

However, after about 10 flow through times, I found it is strange that the mean velocity profile near the chamber inlet plane (the offset position of the mapped flow inlet) is something like "laminar" profile rather than a more "flatter" one. If you have some experience with this, can you give me some hints?
lizzy is offline   Reply With Quote

Old   September 18, 2020, 10:39
Default
  #12
Senior Member
 
Reviewer #2
Join Date: Jul 2015
Location: Gainesville,FL
Posts: 113
Rep Power: 7
randolph is on a distinguished road
Ran,

What is your bulk inlet Reynolds number?

Also, make sure your model has initialized with enough disturbance that can trigger the turbulence.

If your inlet chamber is open channel, I will put the inlet recycling length at least 2pi*D.

If you have everything above correct, then I believe is somewhere in your inlet boundary has problem. You may want to monitor the rescaling and mapped velocity to debug your model.

As a side note, depends on your geometry, OpenFOAM may not be the best choice for LES if your model geometry is relatively simple.

Thanks,
Rdf
randolph 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
Domain Imbalance HMR CFX 5 October 10, 2016 06:57
Can anyone give me some hint on how to make traction free boundary condition? poplar OpenFOAM 3 January 14, 2015 03:37
Boundary Conditions Thomas P. Abraham Main CFD Forum 20 July 7, 2013 06:05
Setting outlet Pressure boundary condition using CAFFA code Mukund Pondkule Main CFD Forum 0 March 16, 2011 04:23
How to set boundary condition in Fluent for the fo Peiyong FLUENT 1 November 10, 2006 12:44


All times are GMT -4. The time now is 06:32.