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

mapped boundary condition

Register Blogs Community New Posts Updated Threads Search

Like Tree16Likes
  • 9 Post By latvietis
  • 6 Post By Linse
  • 1 Post By randolph

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 10, 2012, 07:03
Default mapped boundary condition
  #1
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
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, 22:19
Default
  #2
Member
 
Martin
Join Date: Dec 2011
Location: Latvia
Posts: 54
Rep Power: 14
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, 02:45
Default
  #3
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
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, 06:39
Default
  #4
Member
 
Martin
Join Date: Dec 2011
Location: Latvia
Posts: 54
Rep Power: 14
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, 06:36
Default
  #5
Senior Member
 
Bernhard Linseisen
Join Date: May 2010
Location: Heilbronn
Posts: 183
Blog Entries: 1
Rep Power: 15
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, 07:57
Default
  #6
Member
 
Join Date: Apr 2016
Posts: 90
Rep Power: 10
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, 14:54
Default
  #7
Senior Member
 
Reviewer #2
Join Date: Jul 2015
Location: Knoxville, TN
Posts: 141
Rep Power: 10
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, 18:57
Default
  #8
Senior Member
 
Reviewer #2
Join Date: Jul 2015
Location: Knoxville, TN
Posts: 141
Rep Power: 10
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, 09:47
Default
  #9
New Member
 
Ran Yi
Join Date: May 2019
Posts: 9
Rep Power: 6
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, 09:51
Default
  #10
Senior Member
 
Reviewer #2
Join Date: Jul 2015
Location: Knoxville, TN
Posts: 141
Rep Power: 10
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, 10:14
Default
  #11
New Member
 
Ran Yi
Join Date: May 2019
Posts: 9
Rep Power: 6
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, 09:39
Default
  #12
Senior Member
 
Reviewer #2
Join Date: Jul 2015
Location: Knoxville, TN
Posts: 141
Rep Power: 10
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

Old   November 10, 2021, 06:20
Default
  #13
New Member
 
Lorenzo
Join Date: Feb 2021
Posts: 3
Rep Power: 5
JesusJoker is on a distinguished road
I am sorry, I am afraid I do not understand what is the value I had to specify if I am just mapping points from a place to another one? (it also seems to be mandatory otherwise it won't run)
JesusJoker is offline   Reply With Quote

Old   November 10, 2021, 06:47
Default i have few doubts regrading the Two Phase Separator
  #14
New Member
 
Akshay
Join Date: Jan 2020
Posts: 28
Rep Power: 6
enthusiast is on a distinguished road
Hello Everyone,
I am trying to simulate a two phase separator for water and oxygen, presently I have considered interfoam for this simulation.

I am using OpenFOAM 8, the separator mesh which I am using is attached below. It has 6552 elements.

I am a bit confused regarding whether the solver which I have considered serves the purpose or should I consider MultiphaseEulerFoam where I need to consider another set of equation for oxygen as well?
There is one inlet and two outlets.
Inlet: 2/3rd mass fraction of water and 1/3rd mass fraction of oxygen
Outlet1 is for oxygen and outlet2 is for water.
Other sides are considred as walls and the front and back in Z axis is considered empty.
These are the boundary condition which I have considered

/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 8
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
walls
{
type noSlip;
}

inlet
{
type flowRateInletVelocity;
massFlowRate constant 0.6667;
value uniform (0 0 0);
}

outlet1
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
inletValue uniform (0 0 0);
}

outlet2
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
inletValue uniform (0 0 0);
}

frontandback
{
type empty;
}

}

// ************************************************** *********************** //
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 8
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
walls
{
type noSlip;
}

inlet
{
type flowRateInletVelocity;
massFlowRate constant 0.6667;
value uniform (0 0 0);
}

outlet1
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
inletValue uniform (0 0 0);
}

outlet2
{
type pressureInletOutletVelocity;
value uniform (0 0 0);
inletValue uniform (0 0 0);
}

frontandback
{
type empty;
}

}

// ************************************************** *********************** //
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 8
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [1 -1 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
walls
{
type fixedFluxPressure;
value $internalField;
}

inlet
{
type fixedFluxPressure;
value $internalField;
}

outlet1
{
type fixedValue;
value $internalField;
}

outlet2
{
type fixedValue;
value $internalField;
}

frontandback
{
type empty;
}
}

// ************************************************** *********************** //

Please let me know if my boundary conditions are correct?
Attached Images
File Type: jpg Unbenannt.jpg (22.6 KB, 16 views)
enthusiast 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
Domain Imbalance HMR CFX 5 October 10, 2016 05:57
Can anyone give me some hint on how to make traction free boundary condition? poplar OpenFOAM 3 January 14, 2015 02:37
Boundary Conditions Thomas P. Abraham Main CFD Forum 20 July 7, 2013 05:05
Setting outlet Pressure boundary condition using CAFFA code Mukund Pondkule Main CFD Forum 0 March 16, 2011 03:23
How to set boundary condition in Fluent for the fo Peiyong FLUENT 1 November 10, 2006 11:44


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