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

simpleFoam (RANS) - pitzDaily - mapped BC

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 31, 2019, 12:29
Default simpleFoam (RANS) - pitzDaily - mapped BC
  #1
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Hi Vimal,

Of course! The mapped BC, I wasn't remembering it. One such tutorial is "incompressible/pisoFoam/les/pitzDailyMapped".
And as of OpenFOAM 2.2, you can find more details about boundary conditions and function objects here: http://foam.sourceforge.net/docs/cpp/modules.html

What you're looking for is in the section Coupled boundary Conditions

The general idea is that:
  1. You define in the file "constant/polyMesh/boundary" the geometrical relation between two patches, where one is the slave and the other the master.
    The offset is defined here and is the indication of the relative position between the current patch and the other patch. For example, if your "inlet" is at "X= -5.0m" and the "outlet" is at "X=+10.0m", and if the "inlet" is the one that is defined as the "mappedPatch", then the offset is "(15.0 0 0)". Well, actually, it might have to be "(14.99 0 0)", so that the offset point falls inside the cells that are near the "outlet" patch.
    If the "outlet" was the "mappedPatch", then the offset would be "(-15.0 0 0)"... I mean, "(-14.99 0 0)".
  2. As for the type you defined for the "inlet" in "0/U", it depends on the specific mapped type you're looking for, as listed in the Coupled boundary Conditions.
Best regards,
Bruno
Hi Bruno,

I have doubts related to mapped BC and maybe you can help me.
I have attached an image (Fig.1) of my domain and below are the settings that I used in OpenFOAM so that it was possible to use such a BC.
*I left the grid so you can see the dimensions of my domain.

Code:
blockMeshDict:
    inlet
    {
        type mappedPatch;
        offset          (0 0.1 0);  EDIT 1: The ERROR is here.
        sampleRegion    region0;
        sampleMode      nearestCell;
        samplePatch     none;
        faces
        (
            (0 1 14 13)
            (1 2 15 14)
        );
    }

0/U:
    internalField   uniform (0 0 0);

    inlet
    {
        type            mapped;
        field           U;
        setAverage      1;
        average         (3.45 0 0);
        interpolationScheme cell;
        value           uniform (3.45 0 0);
    }

0/k:
    internalField   uniform 0.04;

    inlet
    {
        type            fixedValue;
        value           uniform 0.04;
    }
Well, from the results, it's clear that what I wanted to do did not work. EDIT 1: Solved.
My intention was that with this BC being able to develop the velocity profile at the inlet.

I put the mapping point above the step, Is it interesting to use this point so close to the entrance?
Unfortunately I was trying to import a velocity profile that I developed into a channel, but it was not succeeding and so I resorted to this option.
Can you suggest something beyond this BC? Unfortunately the mapFields function, as far as I understand, can not import only the U profile from a channel to my inlet backward facing step.

Two other issues are:
Would it be interesting to use directMapped?
From the moment I decided to use this BC, when should I add the mapped condition to my files (k, epsilon ...)? Because I'm just adding in U.

Thanks.

[Moderator note: Moved from simple open channel flow, the inlet and outlet are periodic ]
Attached Images
File Type: jpg domain.jpg (30.5 KB, 81 views)

Last edited by wyldckat; February 3, 2019 at 17:13. Reason: see "Moderator note:"
gu1 is offline   Reply With Quote

Old   January 31, 2019, 14:02
Default simpleFoam (RANS) - pitzDaily - mapped BC
  #2
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
Hi,

Below I've attached two images of two cases I'm working on.
One of the images contains the velocity profile for the channel (v2f-newtoniano) and the other one is a backward facing step (pitzDailyMapped) also using the same model (v2f Model). Both cases have the same BC and both are set to a Re_tau = 395.

The channel domain is cyclic, different from that used in the backward facing step geometry.
In backward facing facing geometry was used to mapped BC, according to the code below.

Code:
blockMeshDict:
    inlet
    {
        type mappedPatch;
        offset          (-0.05 0 0); 
        sampleRegion    region0;
        sampleMode      nearestCell;
        samplePatch     none;
        faces
        (
            (0 1 14 13)
            (1 2 15 14)
        );
    }

0/U:
    internalField   uniform (0 0 0);

    inlet
    {
        type            mapped;
        field           U;
        setAverage      true;
        average         (3.45 0 0);
        interpolationScheme cell;
        value           uniform (3.45 0 0);
    }

0/k:
    internalField   uniform 0.04;

    inlet
    {
        type            mapped;
        field           k;
        setAverage      false;
        average         0.04;
        interpolationScheme cell;
        value           uniform 0.04;
    }

0/epsilon:
    internalField   uniform 0.4;

    inlet
    {
        type            mapped;
        field           epsilon;
        setAverage      false;
        average         0.4;
        interpolationScheme cell;
        value           uniform 0.4;
    }

0/v2:
    internalField   uniform 0.024;

    inlet
    {
        type            mapped;
        field           v2;
        setAverage      false;
        average         0.024;
        interpolationScheme cell;
        value           uniform 0.024;
    }
Why did the velocity profile diverge? The inlet channel of the backward facing step geometry has the same mesh division at Y (y+ <1) as that used for the channel geometry and therefore also has the same height H (0.2 m).
*Remembering again that the same BCs are being used on the wall for both cases.

NOTE: I used the mapped BC for the first time, and the intention was to develop the velocity profile at the inlet geometry (backward facing step), since I am not able to import the channel velocity profile (Could someone advise me here?).
Would it be interesting to use BC directMapped?
Are the conditions I used for k, epsilon, and v2 correct?

Thanks
Attached Images
File Type: jpeg WhatsApp Image 2019-01-31 at 15.01.09.jpeg (132.9 KB, 64 views)
File Type: jpeg WhatsApp Image 2019-01-31 at 15.02.06.jpeg (128.6 KB, 40 views)
File Type: jpg geometry.jpg (23.9 KB, 34 views)
gu1 is offline   Reply With Quote

Old   February 2, 2019, 14:05
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answers:
Quote:
Originally Posted by gu1 View Post
Can you suggest something beyond this BC? Unfortunately the mapFields function, as far as I understand, can not import only the U profile from a channel to my inlet backward facing step.
If your inlet is using a fixed value and your first channel has the last cell overlapping the patch faces on your second case, then it should work... that's what the cut patches (can't remember the exact name) are for... although I never used it myself. The idea is that it would then interpolate the values from one mesh to the other one.
Having the two patches overlap would be a problem.

Quote:
Originally Posted by gu1 View Post
Would it be interesting to use directMapped?
I only have the vague idea that it requires strict mapping...

Quote:
Originally Posted by gu1 View Post
From the moment I decided to use this BC, when should I add the mapped condition to my files (k, epsilon ...)? Because I'm just adding in U.
Mapping only U should be enough, since the other properties can be inferred during simulation... and mapping all others also can potentially cause serious difficulty to converge or generate unexpected flow profiles...

You could also have two meshes within the same case, and having the mapping be done from one mesh to the other one on the patch you have right now... If blockMesh doesn't let you generate the two independent blocks, then you can simply merge the meshes of two cases into a single one, without stitching.
__________________
wyldckat is offline   Reply With Quote

Old   February 2, 2019, 15:04
Default
  #4
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
You could also have two meshes within the same case, and having the mapping be done from one mesh to the other one on the patch you have right now... If blockMesh doesn't let you generate the two independent blocks, then you can simply merge the meshes of two cases into a single one, without stitching.
To do this, without an example, would be quite complex for me. It's my first contact with blockMesh... but thank you for your response.

Incidentally, I even generated a new topic in the forum... if you want to give an opinion, I would be very grateful. LINK.
gu1 is offline   Reply With Quote

Old   February 3, 2019, 17:32
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: Now I'm just confused... if you have a backward step case, you cannot map the velocity field within the same mesh, because the channel widens and therefore changes the profile velocity... it's pretty much a physical reality, therefore it's borderline impossible for that to ever converge...


I've now remember of something that has been released with OpenFOAM 6 and is documented in the respective commit: https://github.com/OpenFOAM/OpenFOAM...a0d9e72d5a7968

Unfortunately I don't have the time needed to work out an example case for this boundary condition
But the tutorial case "incompressible/simpleFoam/pitzDailyExptInlet" can be used as a basis for creating such a case.
gu1 likes this.
__________________
wyldckat is offline   Reply With Quote

Reply

Tags
mapped boundary condition, v2f boundary conditions


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
interFoam vs. simpleFoam channel flow comparison DanM OpenFOAM Running, Solving & CFD 12 January 31, 2020 16:26
simpleFOAM (RANS) - internal pipe flow - 'k' gu1 OpenFOAM Running, Solving & CFD 1 May 15, 2018 08:17
PitzDaily example and simpleFoam csomerlot OpenFOAM Running, Solving & CFD 2 November 6, 2013 12:20
simpleFoam 2d Case RANS Issues mosquera OpenFOAM Running, Solving & CFD 0 July 1, 2013 08:23
the result of pitzDaily using simpleFoam and pisoFoam Kr_kim OpenFOAM Running, Solving & CFD 1 March 16, 2010 14:38


All times are GMT -4. The time now is 23:49.