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

Some Problems about the Boundary Conditions in OpenFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 31, 2015, 17:00
Default
  #21
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
HERE'S what i get

Checking geometry...
Overall domain bounding box (0 0 0) (0.0001 0.00057 5e-05)
Mesh (non-empty, non-wedge) directions (1 1 0)
Mesh (non-empty) directions (1 1 0)
All edges aligned with or perpendicular to non-empty directions.
Boundary openness (2.34216e-17 0 4.68431e-17) OK.
Max cell openness = 1.0982e-16 OK.
Max aspect ratio = 43.6937 OK.
Minimum face area = 1.14433e-10. Maximum face area = 5e-09. Face area magnitudes OK.
Min volume = 1.14433e-14. Max volume = 5.72165e-14. Total volume = 2.85e-12. Cell volumes OK.
Mesh non-orthogonality Max: 0 average: 0
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 0.197788 OK.
Coupled point location match (average 0) OK.

Mesh OK.

End
sabago is offline   Reply With Quote

Old   October 31, 2015, 17:57
Default
  #22
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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
Then shouldn't the file "tcath.dat" have these values?
Code:
(
(0.00000 2.5)
(0.00025 3)
(0.00035 4)
)
I say this because of this:
Code:
Overall domain bounding box (0 0 0) (0.0001 0.00057 5e-05)
In addition to this, in ParaView, are you looking at the last time snapshot?
wyldckat is offline   Reply With Quote

Old   November 1, 2015, 03:05
Default
  #23
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
i am checking the last time step in paraview. and i have this for my .dat file

Code:
((0e-6 4)
(25e-6 3)
(35e-6 2.5)


)
____________

i also tried
Code:
(
(0e-6 2.5)
(25e-6 3)
(35e-6 4)


)
____________

i am checking the last time step in paraview. and i have this for my .dat file

Code:
((0e-6 4)
(25e-6 3)
(35e-6 2.5)


)
and
Code:
(
(570e-6 2.5)
(545e-6 3)
(535e-6 4)
)
____________

I notice that you use a name different from the .dat file name as I do. COuld that be causing my problems?

Last edited by wyldckat; November 1, 2015 at 15:32. Reason: merged posts that were a few minutes apart
sabago is offline   Reply With Quote

Old   November 1, 2015, 15:39
Default
  #24
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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
Hi Sandra,

Quote:
Originally Posted by sabago View Post
Code:
(
(570e-6 2.5)
(545e-6 3)
(535e-6 4)
)
It's best to use the first column ordered from smallest to largest:
Code:
(
(535e-6 4)
(545e-6 3)
(570e-6 2.5)
)
But there is something strange with these numbers... what is the mesh resolution that you are using? Because this assumes that you have at least 3 cells between "535e-6" and "570e-6".


Quote:
Originally Posted by sabago View Post
I notice that you use a name different from the .dat file name as I do. COuld that be causing my problems?
This would only be a problem if you are not editing the file "tcath.dat" in the correct folder.
Try running this command inside the case folder:
Code:
find -name tcath.dat
it will tell you the paths where it finds this file is located.

If this doesn't help, then I strongly suggest that you take a step back and test with another test case, preferably one of OpenFOAM's tutorial cases. I say this because sometimes there are certain details that we only see when we look at them from a different perspective.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   November 2, 2015, 05:51
Default
  #25
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Hi Sandra,


It's best to use the first column ordered from smallest to largest:
Code:
(
(535e-6 4)
(545e-6 3)
(570e-6 2.5)
)
But there is something strange with these numbers... what is the mesh resolution that you are using? Because this assumes that you have at least 3 cells between "535e-6" and "570e-6".
Best regards,
Bruno
hi Bruno,, how can i determine my resolution? all i know is that the parameter that i want to change is 50micron along y
sabago is offline   Reply With Quote

Old   November 2, 2015, 17:08
Default
  #26
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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
Quote:
Originally Posted by sabago View Post
hi Bruno,, how can i determine my resolution? all i know is that the parameter that i want to change is 50micron along y
Quick answer: If you created the mesh, you should know what resolution you have defined

If you used blockMesh, check how you defined the blocks. For example, in the tutorial case "incompressible/icoFoam/cavity", the following definitions were used:
Code:
convertToMeters 0.1;

vertices
(
    (0 0 0)
    (1 0 0)
    (1 1 0)
    (0 1 0)
    (0 0 0.1)
    (1 0 0.1)
    (1 1 0.1)
    (0 1 0.1)
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1)
);
Which means that the mesh is 0.1 by 0.1 by 0.01 (m) in total dimensions, divided in a cell distribution of 20 by 20 by 1, which equals to a resolution of 0.005 by 0.005 by 0.01 (m).
wyldckat is offline   Reply With Quote

Old   November 2, 2015, 17:11
Default
  #27
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
oh, my resolution is 100micronx5.7micronx50micron
sabago is offline   Reply With Quote

Old   November 7, 2015, 11:31
Default
  #28
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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
Hi Sandra,

I hope you've figured out what the problem was.
If not, we need a common example to work with, in order to make it easier to diagnose what it is the exact problem. Otherwise we'll be going back and forth with a guessing game for which I don't have enough time for.

If you can share your case at least privately, send me a PM with a download link for the case on DropBox or similar file sharing service. If not, then please use one of OpenFOAM's tutorials as a base for creating a similar case structure and then share it here. That way it's a lot easier to figure out what the exact problem is.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   November 9, 2015, 09:53
Default
  #29
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
will PM you
sabago is offline   Reply With Quote

Old   November 9, 2015, 13:54
Default
  #30
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
what did you set as your internalField at 0/U?
It seems that mine only reads the internalField.

Sandra
Quote:
Originally Posted by wyldckat View Post
Greetings to all!

@Sandra: I'm going to use part of the PM you sent me to answer your question, since the two topics are related:


This is one of those situations I have to test things myself, namely to do some trial-and-error. I've tested the following in the tutorial case "incompressible/icoFoam/cavity":
  1. In "0/U":
    Code:
        movingWall
        {
            type groovyBC;
    
            lookuptables (
                {
                    name dataMe;
                    outOfBounds clamp;
                    fileName "$FOAM_CASE/data.dat";
                }
            );
    
            valueExpression "vector(dataMe(pos().x),0.0,0.0)";
            value           uniform (1 0 0);
        }
  2. Created the file "data.dat" in the "cavity" folder:
    Code:
    (
    (0    2.5)
    (0.05 3)
    (0.1  4)
    )
  3. In "system/controlDict" I added this line:
    Code:
    libs ("libgroovyBC.so");
And it ran fine. The detail is that you are trying to use the field name "y", when you should instead use "pos().y":
Code:
tcath(pos().y)
I think that the entry "fields" is not used, namely this one:
Code:
 fields
    (y tc);
If this still doesn't work, then perhaps the values for "pos().y" aren't the ones you're planning for? For example, if your calculations are in millimetre, but the mesh is in metre, then it's somewhat natural that this problem occurs.

Best regards,
Bruno
sabago is offline   Reply With Quote

Old   November 15, 2015, 13:41
Default
  #31
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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
Hi Sandra,

I've finally managed to take a look into this today.
Quote:
Originally Posted by sabago View Post
what did you set as your internalField at 0/U?
It seems that mine only reads the internalField.
In the test case I did, I only changed the boundary condition, the rest is the original settings in the tutorial.

Quoting from the PM you sent me:
Quote:
Originally Posted by sabago
After running the case, the parameters that I'm looking at in ParaView are "jbvag" and "jbvcg"; after integration, they should be the same within some error.
But changing the values in my .dat files doesn't do anything to the values of "jbvag" and "jbvcg" but changing the internalField shows a difference.
Actually, I had to look at the files "0/anode/pang" and "0/anode/tang", which were the ones with the groovyBC boundary conditions. Fortunately, since you sent me the code for solver as well, I was able to pinpoint the problem.
For example, since the fields "pang" and "tang" are used only for conventional calculations and are not part of equations, then their boundary conditions aren't updated and are used as-is after loading. In order to force the update you need to call the method "correctBoundaryConditions()". For example, for the field "pang" you need to call this method right after loading it:
Code:
    Info<< "Reading pang\n" << endl;
    volScalarField pang
    (
        IOobject
        (
            "pang",
            runTime.timeName(),
            anodeMesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        anodeMesh
    );
    pang.correctBoundaryConditions();
The last line is the new code.

If you do this for all of the relevant fields, then things should finally work as intended.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   December 14, 2015, 09:39
Default
  #32
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
Hi Bruno,

I did try your suggestion but it seems that it's still only reading the internal field.
I PMed you the revised solver (and case).

Best,
Sandra
sabago is offline   Reply With Quote

Old   December 28, 2015, 18:19
Default
  #33
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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
Hi Sandra,

I have to say that I feel a bit lost on where I should look at to see the problem.
Here are the steps I took:
  1. I downloaded the folders you sent me and I ran inside the folder "ysofcFoam" the following commands:
    Code:
    wclean
    wmake
    Note: I used OpenFOAM 2.3.1.
  2. Then I went to the folder of the case "YSOFC" and ran the solver ysofcFoam.
  3. I aborted the run after several iterations, where it stopped at around "0.00113".
  4. Then I opened the case in ParaView with this command:
    Code:
    paraFoam -builtin
  5. Then I selected only the surface mesh patches "anode/anode_inlet" and "anode/fixedWalls".
  6. From the fields list, I selected only the "pang" field.
  7. Also turned on the "Cube Axes", which is an option more at the bottom of the "Properties" widget (the small window on the bottom left entitled "Properties").
  8. Then clicked on the "Apply" button.
  9. Then went to the next time step "1e-05" and changed the view to see what I see in the attached image.
    • Notice the several settings that are shown in the image, such as the represented field and the represented time step.
As you can see in the attached image, everything seems to be working as intended, given that the "pan.dat" file has this:
Code:
(
(69e-6 0)
(70e-6 0.17)
(90e-6    0.17)
(91e-6  0.3)
(570e-6 0.3)
)
The first column refers to the Y axis position and the second column is the value to be represented in the "pang" field.

If you follow these same steps, are you able to see the same results?
What is the exact problem I should be looking for?

Best regards,
Bruno
Attached Images
File Type: jpg Screenshot from 2015-12-28 23-04-37.jpg (113.2 KB, 26 views)
__________________
wyldckat is offline   Reply With Quote

Old   January 11, 2016, 06:55
Default
  #34
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
how do I get the "represented field" and "time" to show in the plot?
sabago is offline   Reply With Quote

Old   January 31, 2016, 11:57
Default
  #35
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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 question: Are you referring to a 2D plot or a 3D view?

Last edited by wyldckat; January 31, 2016 at 11:57. Reason: rephrased question
wyldckat is offline   Reply With Quote

Old   February 24, 2016, 13:53
Default
  #36
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
2D plot view
sabago is offline   Reply With Quote

Old   March 25, 2016, 12:12
Default
  #37
Member
 
Join Date: Feb 2016
Posts: 41
Rep Power: 10
LeeRuns is on a distinguished road
Quote:
Originally Posted by Axel_T View Post
Hi Why,

there are many types of BC, right. But they are all set in the fieldvariables in your first time-dictionary.

A simple pipe for example would have a inlet, outlet and fixed walls, when you defined the boundaries right during mesh-generation.
In the time-dictionary /0 must be for example the file of the pressure variable: /0/p
In that file there is a entry for the initial state:
internalField uniform 100000;
and a sub-dictionary for the boundaries:
boundaryField
{
inlet
{
type fixedValue;
value uniform 1.1e5;
}

fixedWalls
{
type zeroGradient;
}

outlet
{
type fixedValue;
value uniform 1e5;
}
}
For the velocity at the inlet, there is a BC called pressureInletOutletVelocity which calculates the velocity depending on the pressure.

Take a look at the OF-UserGuide chapter 5.2 especially page U-133

bye
Axel

i have run 2 cases (icoFOam and nonNewtonian Icofoam). I see you are defining the initial conditions in your p and u files as individual scalars. All of my are x,y,x component of u or p at that boundary. How are you describing x,y,x with just an individual value?

Last edited by LeeRuns; March 25, 2016 at 12:12. Reason: formatting
LeeRuns is offline   Reply With Quote

Old   March 28, 2016, 15:34
Default
  #38
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
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
Greetings to all!

@Sandra:
Quote:
Originally Posted by sabago View Post
2D plot view
Sorry, but only today did I finally manage to take a look into this. Attached is the image "ParaView 4.4 2D plot options.jpg" that shows how it can be configured in ParaView 4.4. I could not find similar settings on ParaView 4.1.0.
Notice 3 important details on the left side of the image, inside the "Properties" tab:
  1. The gear icon (below the blue question mark "?") is turned on.
  2. The "Series Parameters" has the selection of the desired field to be plotted.
  3. The "Chart Title" is defined as:
    Code:
    Time so far: ${TIME}s
    where "${TIME}" is the place-holder keyword that ParaView provides for representing the time.
  4. A bit below the chart title option, which is not shown in the image, is the option to show the legend with the names of the plotted fields.

@LeeRuns:
Quote:
Originally Posted by LeeRuns View Post
i have run 2 cases (icoFOam and nonNewtonian Icofoam). I see you are defining the initial conditions in your p and u files as individual scalars. All of my are x,y,x component of u or p at that boundary. How are you describing x,y,x with just an individual value?
For example, this:
Code:
value       uniform 1e5;
means that all entries are uniformly set to 100000. If there was at least one different value, then this would actually be something like:
Code:
value nonuniform 234(1e5 1e5 .... 1e4 ... 1e5);
where the dots are just hinting there there would be more values there.

In order to set values depending on X, Y, Z positions, you can use funkySetFields: http://openfoamwiki.net/index.php/Co...funkySetFields

Best regards,
Bruno
Attached Images
File Type: jpg ParaView 4.4 2D plot options.jpg (126.2 KB, 5 views)
LeeRuns likes this.
__________________
wyldckat is offline   Reply With Quote

Old   April 15, 2017, 03:26
Default boundary condition
  #39
New Member
 
Bharadwaj Bhushan
Join Date: Mar 2017
Posts: 19
Rep Power: 9
Bharath Bhushan is on a distinguished road
hello guys,



I am confused with the boundary conditions. I want to simulate nozzle flow with water as fluid.

I have these values-

velocity at inlet = 1.46m/s
total pressure = 6 Bar
simpleFoam with either kepsilon or kOmega

I set the conditions as

velocity - inlet (fixedValue 1.43), outlet (zeroGradient)
pressure - inlet (zeroGradient), outlet (fixedValue uniform 0)

when I see it in the paraview, the pressure at the inlet shows 2000 pascal, but the actual value is around 5 Bar.

Actually I am confused with the pressure boundary conditions. Whether in simpleFoam, pressure in 0/p takes static or dynamic or total pressure ?.

please can anybody suggest appropriate boundary condition for my case ?


thank you

Bharadwaj
Bharath Bhushan is offline   Reply With Quote

Old   April 15, 2017, 07:35
Default
  #40
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
> total pressure = 6 Bar

I think you mean the pressure difference between inlet and outlet.

You may set this difference and calculate the velocity or set the velocity and calculate the pressure difference.

If you have measured values and the results of your calculation differ, you have a good example to learn how OF needs to be set and which degree of accuracy can be reached with fluid simulations.

Please keep in mind: When simulating incompressible, OF takes the kinematic pressure.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 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
Implementation of boundary conditions for FVM Tom Main CFD Forum 7 August 26, 2014 05:58
symmetry boundary conditions in cfx lost.identity CFX 41 May 22, 2013 07:21
LES of channel with cylic boundary mapping boundary conditions Thomas Baumann Siemens 0 August 24, 2009 09:53
compressible boundary conditions vivian Main CFD Forum 8 April 24, 2006 06:23
Boundary conditions? Tom Main CFD Forum 0 November 5, 2002 01:54


All times are GMT -4. The time now is 08:45.