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

[blockMesh] Channel with vertical element

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 7, 2011, 15:56
Default Channel with vertical element
  #1
New Member
 
Kristin Kerst
Join Date: Jan 2011
Posts: 11
Rep Power: 15
kriskerst is on a distinguished road
Hello,
I tried to create a channel with a vertical element in it. I "build" it with blockMesh.
Without the element in the channel, I get good results.
But with the element, I get unbelievable high velocity.
I changed the geometry several times, but it doesn't became better. (And checkMesh gives me OK.)

If somebody has some experience with the same probleme, it would be great.

My blockMeshDic:


/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
(-0.1365 0 0)
(0 0 0)
(0.013 0 0)
(0.5135 0 0)
(-0.1365 0 0.0455)
(0.0455 0 0.0455)
(0.0585 0 0.0455)
(0.5135 0 0.0455)
(-0.1365 0 0.091)
(0 0 0.091)
(0.013 0 0.091)
(0.5135 0 0.091)

(-0.1365 0.039 0)
(0 0.039 0)
(0.013 0.039 0)
(0.5135 0.039 0)
(-0.1365 0.039 0.0455)
(0.0455 0.039 0.0455)
(0.0585 0.039 0.0455)
(0.5135 0.039 0.0455)
(-0.1365 0.039 0.091)
(0 0.039 0.091)
(0.013 0.039 0.091)
(0.5135 0.039 0.091)

(-0.1365 0.052 0)
(0 0.052 0)
(0.013 0.052 0)
(0.5135 0.052 0)
(-0.1365 0.052 0.0455)
(0.0455 0.052 0.0455)
(0.0585 0.052 0.0455)
(0.5135 0.052 0.0455)
(-0.1365 0.052 0.091)
(0 0.052 0.091)
(0.013 0.052 0.091)
(0.5135 0.052 0.091)

(-0.1365 0.091 0)
(0 0.091 0)
(0.013 0.091 0)
(0.5135 0.091 0)
(-0.1365 0.091 0.0455)
(0.0455 0.091 0.0455)
(0.0585 0.091 0.0455)
(0.5135 0.091 0.0455)
(-0.1365 0.091 0.091)
(0 0.091 0.091)
(0.013 0.091 0.091)
(0.5135 0.091 0.091)
);

edges
(
);

blocks
(
hex (0 1 13 12 4 5 17 16) (30 10 11) simpleGrading (0.5 1 1)
hex (1 2 14 13 5 6 18 17) (4 10 11) simpleGrading (1 1 1)
hex (2 3 15 14 6 7 19 18) (80 10 11) simpleGrading (3 1 1)
hex (12 13 25 24 16 17 29 28) (30 4 11) simpleGrading (0.5 1 1)

hex (14 15 27 26 18 19 31 30) (80 4 11) simpleGrading (3 1 1)
hex (24 25 37 36 28 29 41 40) (30 10 11) simpleGrading (0.5 1 1)
hex (25 26 38 37 29 30 42 41) (4 10 11) simpleGrading (1 1 1)
hex (26 27 39 38 30 31 43 42) (80 10 11) simpleGrading (3 1 1)

hex (4 5 17 16 8 9 21 20) (30 10 11) simpleGrading (0.5 1 1)
hex (5 6 18 17 9 10 22 21) (4 10 11) simpleGrading (1 1 1)
hex (6 7 19 18 10 11 23 22) (80 10 11) simpleGrading (3 1 1)
hex (16 17 29 28 20 21 33 32) (30 4 11) simpleGrading (0.5 1 1)

hex (18 19 31 30 22 23 35 34) (80 4 11) simpleGrading (3 1 1)
hex (28 29 41 40 32 33 45 44) (30 10 11) simpleGrading (0.5 1 1)
hex (29 30 42 41 33 34 46 45) (4 10 11) simpleGrading (1 1 1)
hex (30 31 43 42 34 35 47 46) (80 10 11) simpleGrading (3 1 1)
);

patches // keyword
(
patch // patch type for patch 0
inlet // patch name
(
(0 12 16 4)
(12 24 28 16)
(24 36 40 28)
(4 16 20 8)
(16 28 32 20)
(28 40 44 32)
) // end of 0th patch definition

patch // patch type for patch 1
outlet // arbitrary patch name
(
(3 15 19 7)
(15 27 31 19)
(27 39 43 31)
(7 19 23 11)
(19 31 35 23)
(31 43 47 35)
)

wall Wall
(
(0 1 5 4)
(1 2 6 5)
(2 3 7 6)
(4 5 9 8)
(5 6 10 9)
(6 7 11 10)

(8 9 21 20)
(9 10 22 21)
(10 11 23 22)
(20 21 33 32)
(22 23 35 34)
(32 33 45 44)
(33 34 46 45)
(34 35 47 46)

(36 37 41 40)
(37 38 42 41)
(38 39 43 42)
(40 41 45 44)
(41 42 46 45)
(42 43 47 46)

(0 1 13 12)
(1 2 14 13)
(2 3 15 14)
(12 13 25 24)
(14 15 27 26)
(24 25 37 36)
(25 26 38 37)
(26 27 39 38)

(13 14 18 17)
(17 18 22 21)
(14 26 30 18)
(18 30 34 22)
(25 26 30 29)
(29 30 34 33)
(13 25 29 17)
(17 29 33 21)
)
);

mergePatchPairs
(
);

// ************************************************** *********************** //
kriskerst is offline   Reply With Quote

Old   February 7, 2011, 17:59
Default
  #2
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22
MartinB will become famous soon enough
Hi Kristin,

your mesh works for me, see the attached case...

Run with:
blockMesh
simpleFoam

You should post your complete case, if you still have problems...

Martin
Attached Files
File Type: gz channel_with_element.tar.gz (3.4 KB, 31 views)
MartinB is offline   Reply With Quote

Old   February 8, 2011, 06:20
Default
  #3
New Member
 
Kristin Kerst
Join Date: Jan 2011
Posts: 11
Rep Power: 15
kriskerst is on a distinguished road
Hello Martin,
thank you much for you answer.
I actually also tried it with simpleFoam and the results are good.

I should have mentioned: At first I tried it with icoFoam. So, I think the problem was the wrong solver.

It might be another forum, but I try to build a static mixer. (In my mesh there is only the first element.) I'd like to get a concentration field (skalar field) of a tracer fluid, that comes in a little injector in the channel.

Do you think, that it is possible?
I thought about using scalarTranportFoam for the Problem, but I don't know, how to define the small "injector-inlet"

Many greetings
Kristin
kriskerst is offline   Reply With Quote

Old   February 8, 2011, 07:03
Default
  #4
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22
MartinB will become famous soon enough
Hi Kristin,

icoFoam and nonNewtonianIcoFoam are running fine, too. You must set a rather small time step, so that the courant number stays low.

Quote:
It might be another forum, but I try to build a static mixer. (In my mesh there is only the first element.) I'd like to get a concentration field (skalar field) of a tracer fluid, that comes in a little injector in the channel.

Do you think, that it is possible?
Shouldn't be that difficult.

What kind of fluid do you want to handle? Water, or some nonnewtonian fluid?
Is it turbulent flow or laminar?
Is it compressible or incompressible?
Does the scalar to be mixed in take influence on the flow (i.e. can it be handled as a passive scalar transport or not)?

A simple approach would be:
- use simpleFoam as a base
- add a passive scalar transport as described here: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam
- add an additional patch to your mesh (p.e. in the middle of the inlet patch) which handles the scalar input (this patch has fixed inlet value of 1, rest of inlet patch has inlet value 0)

Best regards

Martin
MartinB is offline   Reply With Quote

Old   February 8, 2011, 09:17
Default
  #5
New Member
 
Kristin Kerst
Join Date: Jan 2011
Posts: 11
Rep Power: 15
kriskerst is on a distinguished road
Hello Martin,
you are right, I decreased the timestep once again and now it works.

(For estimating the timestep, I used following:

Co = (u* delta t)/delta x (Co ... <1)
u = 0.1 m/s
delta x = 0.0026 m
==> delta t = 0.0208 s
(Don't know why it is not okay.))


What kind of fluid do you want to handle? Water, or some nonnewtonian fluid? water

Is it turbulent flow or laminar? laminar, for the first

Is it compressible or incompressible? incompressible

Does the scalar to be mixed in take influence on the flow (i.e. can it be handled as a passive scalar transport or not)? it can be handled as a passive scalar

A simple approach would be:
- use simpleFoam as a base
Okay.

- add a passive scalar transport as described here: http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam
The tutorial confuses me. How to define the passive scalar things? (Sorry, it's my first project with OpenFOAM.)

- add an additional patch to your mesh (p.e. in the middle of the inlet patch)
Yes, that's where the injection is located. Do I have to define this in the blockMeshDic? If yes, how?

which handles the scalar input (this patch has fixed inlet value of 1, rest of inlet patch has inlet value 0)
Whould be great, if this would work.

Best regards
Kristin
kriskerst is offline   Reply With Quote

Old   February 8, 2011, 09:34
Default
  #6
New Member
 
Kristin Kerst
Join Date: Jan 2011
Posts: 11
Rep Power: 15
kriskerst is on a distinguished road
By the way, this is how the static mixer looks like:
I started with the simulation around a single element.
Thank you for your help.
Attached Images
File Type: jpg skizze2.JPG (26.7 KB, 35 views)
kriskerst is offline   Reply With Quote

Old   February 8, 2011, 10:27
Default
  #7
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22
MartinB will become famous soon enough
Your static mixer will look great, especially if you make your whole mesh with blockMesh

Actually, I thought about doing exactly this to improve mixture of clay like ceramics for extrusion process.

Concerning your estimation of the Co number: start a simulation with a much lower Co, let's say Co < 0.01. You can increase the timestep during runtime, as soon, as the simulation starts converging.

Another fine solution is to use the automatic determined Courant number as it is done in interFoam. Have a look there, you only have to copy a few lines of code to make icoFoam use it, too.

On the other hand, simpleFoam is the best choice to get results fast (due to its steady state flow approach).

And if you want to stay with blockMesh, you should consider creating the meshes in parameterized way. I use python to create my blockMeshDicts (simple example is here, see post #4: http://www.cfd-online.com/Forums/ope...arge-mesh.html).

If you search the forum you will find the m4 tool, which is used quite commonly to automize blockMeshDict creation.

Another useful hint for blockMesh: you can add a name for each block, so you can handle the mesh very conveniently in paraFoam. Just define the blocks this way:
Code:
hex (0 1 13 12 4 5 17 16) name_for_this_block (30 10 11) simpleGrading (0.5 1 1)
Furthermore there is a way to use double grading for blockMesh, it's explained here: http://www.cfd-online.com/Forums/ope...e-grading.html

When dealing with additional segments of your static mixer, have a look at the mergePatchPairs functionality. You can stick the segments together without having the topology going through the whole geometry.

To start with your simpleFoam improvement: copy the simpleFoam solver to your $(FOAM_USER_APPBIN) folder, so that you don't mess up with the original source codes. It's described in the "confusing" tutorial in step 2.

Instead of using a field "T", name it the way you prefer ("coloredWater" for example). Following the tutorial should give you the solution you are looking for.

Quote:
- add an additional patch to your mesh (p.e. in the middle of the inlet patch)
Yes, that's where the injection is located. Do I have to define this in the blockMeshDic? If yes, how?
Yes, just add an additional block in the center of the inlet. You can use the mergePatchPairs functionality to keep things simple.

But before I take all the fun of exploring and programming OpenFOAM away from you, I should stop here

Have fun

Martin
MartinB is offline   Reply With Quote

Old   February 8, 2011, 12:14
Default
  #8
New Member
 
Kristin Kerst
Join Date: Jan 2011
Posts: 11
Rep Power: 15
kriskerst is on a distinguished road
Hello Martin,
thank you for your tipps with blockMesh. Yes, I want to try it with blockMesh.

Improving simpleFoam seems to be not easy for me. I am not very familiar with programming, but I'll try. Hope, it will work.

And one last question, do you think, that scalarTransportFoam could help?

Many greetings
kriskerst is offline   Reply With Quote

Old   February 8, 2011, 12:37
Default
  #9
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22
MartinB will become famous soon enough
Hi Kristin,

after running simpleFoam you will have an U file for the converged simulation. With this U you can start scalarTransportFoam as a follow up simulation.

However it might run faster (and may be more convenient) if you include the scalar transport into the steady state solver simpleFoam, since scalarTransportFoam is a time discretized solver.

But you are free to choose...

Martin
MartinB is offline   Reply With Quote

Old   February 8, 2011, 12:44
Default
  #10
New Member
 
Kristin Kerst
Join Date: Jan 2011
Posts: 11
Rep Power: 15
kriskerst is on a distinguished road
Thank you so much and wish you a good evening.
kriskerst is offline   Reply With Quote

Old   February 8, 2011, 14:45
Default
  #11
New Member
 
Kristin Kerst
Join Date: Jan 2011
Posts: 11
Rep Power: 15
kriskerst is on a distinguished road
Hello Martin,
I tried scalarTransportFoam and it seems to work.
I defined one inlet separately (28 40 32 20) in my old blockMeshDic.

Now I am hanging with the "MergePairs-function". I searched in the forum and read http://www.openfoam.com/docs/user/blockMesh.php, but I don't know, how to split the patch.

If you could help me once more, it would be great.
My blockMeshDic:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
(-0.1365 0 0)
(0 0 0)
(0.013 0 0)
(0.5135 0 0)
(-0.1365 0 0.0455)
(0.0455 0 0.0455)
(0.0585 0 0.0455)
(0.5135 0 0.0455)
(-0.1365 0 0.091)
(0 0 0.091)
(0.013 0 0.091)
(0.5135 0 0.091)

(-0.1365 0.039 0)
(0 0.039 0)
(0.013 0.039 0)
(0.5135 0.039 0)
(-0.1365 0.039 0.0455)
(0.0455 0.039 0.0455)
(0.0585 0.039 0.0455)
(0.5135 0.039 0.0455)
(-0.1365 0.039 0.091)
(0 0.039 0.091)
(0.013 0.039 0.091)
(0.5135 0.039 0.091)

(-0.1365 0.052 0)
(0 0.052 0)
(0.013 0.052 0)
(0.5135 0.052 0)
(-0.1365 0.052 0.0455)
(0.0455 0.052 0.0455)
(0.0585 0.052 0.0455)
(0.5135 0.052 0.0455)
(-0.1365 0.052 0.091)
(0 0.052 0.091)
(0.013 0.052 0.091)
(0.5135 0.052 0.091)

(-0.1365 0.091 0)
(0 0.091 0)
(0.013 0.091 0)
(0.5135 0.091 0)
(-0.1365 0.091 0.0455)
(0.0455 0.091 0.0455)
(0.0585 0.091 0.0455)
(0.5135 0.091 0.0455)
(-0.1365 0.091 0.091)
(0 0.091 0.091)
(0.013 0.091 0.091)
(0.5135 0.091 0.091)

(-0.1365 0.039 0.06825) //additional point 1
(-0.1365 0.052 0.06825) //additional point 2
);

edges
(
);

blocks
(
hex (0 1 13 12 4 5 17 16) (30 10 11) simpleGrading (0.5 1 1)
hex (1 2 14 13 5 6 18 17) (4 10 11) simpleGrading (1 1 1)
hex (2 3 15 14 6 7 19 18) (80 10 11) simpleGrading (3 1 1)
hex (12 13 25 24 16 17 29 28) (30 4 11) simpleGrading (0.5 1 1)

hex (14 15 27 26 18 19 31 30) (80 4 11) simpleGrading (3 1 1)
hex (24 25 37 36 28 29 41 40) (30 10 11) simpleGrading (0.5 1 1)
hex (25 26 38 37 29 30 42 41) (4 10 11) simpleGrading (1 1 1)
hex (26 27 39 38 30 31 43 42) (80 10 11) simpleGrading (3 1 1)

hex (4 5 17 16 8 9 21 20) (30 10 11) simpleGrading (0.5 1 1)
hex (5 6 18 17 9 10 22 21) (4 10 11) simpleGrading (1 1 1)
hex (6 7 19 18 10 11 23 22) (80 10 11) simpleGrading (3 1 1)
hex (16 17 29 28 20 21 33 32) (30 4 11) simpleGrading (0.5 1 1)

hex (18 19 31 30 22 23 35 34) (80 4 11) simpleGrading (3 1 1)
hex (28 29 41 40 32 33 45 44) (30 10 11) simpleGrading (0.5 1 1)
hex (29 30 42 41 33 34 46 45) (4 10 11) simpleGrading (1 1 1)
hex (30 31 43 42 34 35 47 46) (80 10 11) simpleGrading (3 1 1)
);

patches // keyword
(
patch // patch type for patch 0
inlet1 // patch name
(
(0 12 16 4)
(12 24 28 16)
(24 36 40 28)
(4 16 20 8)
(16 28 32 20)
(28 40 49 48)
) // end of 0th patch definition
patch // patch type for patch 0
inlet2 // patch name
(
(28 40 49 48)
) // end of 1th patch definition

patch // patch type for patch 1
outlet // arbitrary patch name
(
(3 15 19 7)
(15 27 31 19)
(27 39 43 31)
(7 19 23 11)
(19 31 35 23)
(31 43 47 35)
)

wall Wall
(
(0 1 5 4)
(1 2 6 5)
(2 3 7 6)
(4 5 9 8)
(5 6 10 9)
(6 7 11 10)

(8 9 21 20)
(9 10 22 21)
(10 11 23 22)
(20 21 33 32)
(22 23 35 34)
(32 33 45 44)
(33 34 46 45)
(34 35 47 46)

(36 37 41 40)
(37 38 42 41)
(38 39 43 42)
(40 41 45 44)
(41 42 46 45)
(42 43 47 46)

(0 1 13 12)
(1 2 14 13)
(2 3 15 14)
(12 13 25 24)
(14 15 27 26)
(24 25 37 36)
(25 26 38 37)
(26 27 39 38)

(13 14 18 17)
(17 18 22 21)
(14 26 30 18)
(18 30 34 22)
(25 26 30 29)
(29 30 34 33)
(13 25 29 17)
(17 29 33 21)
)
);

mergePatchPairs
(
(inlet1 inlet2) // merge patch pair 0
);

// ************************************************** *********************** //
kriskerst is offline   Reply With Quote

Old   February 8, 2011, 15:39
Default
  #12
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22
MartinB will become famous soon enough
Hi Kristin,

first, here is a simple example how to use the mergePatchPairs stuff:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
(-0.1365 0 0)
(0 0 0)
(0.013 0 0)
(0.5135 0 0)
(-0.1365 0 0.0455)
(0.0455 0 0.0455)
(0.0585 0 0.0455)
(0.5135 0 0.0455)
(-0.1365 0 0.091)
(0 0 0.091)
(0.013 0 0.091)
(0.5135 0 0.091)

(-0.1365 0.039 0) // 12
(0 0.039 0)
(0.013 0.039 0)
(0.5135 0.039 0)
(-0.1365 0.039 0.0455)
(0.0455 0.039 0.0455)
(0.0585 0.039 0.0455)
(0.5135 0.039 0.0455)
(-0.1365 0.039 0.091) // 20
(0 0.039 0.091)
(0.013 0.039 0.091)
(0.5135 0.039 0.091)

(-0.1365 0.052 0)
(0 0.052 0)
(0.013 0.052 0)
(0.5135 0.052 0)
(-0.1365 0.052 0.0455)
(0.0455 0.052 0.0455)
(0.0585 0.052 0.0455) // 30
(0.5135 0.052 0.0455)
(-0.1365 0.052 0.091)
(0 0.052 0.091)
(0.013 0.052 0.091)
(0.5135 0.052 0.091)

(-0.1365 0.091 0)
(0 0.091 0)
(0.013 0.091 0)
(0.5135 0.091 0)
(-0.1365 0.091 0.0455) // 40
(0.0455 0.091 0.0455)
(0.0585 0.091 0.0455)
(0.5135 0.091 0.0455)
(-0.1365 0.091 0.091)
(0 0.091 0.091)
(0.013 0.091 0.091)
(0.5135 0.091 0.091) // 47

(-0.1365 0.039 0.06825) //additional point 1
(-0.1365 0.052 0.06825) //additional point 2

(-0.2 0 0) // 50  martins points
(-0.2 0.091 0)
(-0.2 0.091 0.091)
(-0.2 0 0.091)

(-0.1365 0 0) // 54  martins points
(-0.1365 0.091 0)
(-0.1365 0.091 0.091)
(-0.1365 0 0.091)


);

edges
(
);

blocks
(
hex (0 1 13 12 4 5 17 16) (30 10 11) simpleGrading (0.5 1 1)
hex (1 2 14 13 5 6 18 17) (4 10 11) simpleGrading (1 1 1)
hex (2 3 15 14 6 7 19 18) (80 10 11) simpleGrading (3 1 1)
hex (12 13 25 24 16 17 29 28) (30 4 11) simpleGrading (0.5 1 1)

hex (14 15 27 26 18 19 31 30) (80 4 11) simpleGrading (3 1 1)
hex (24 25 37 36 28 29 41 40) (30 10 11) simpleGrading (0.5 1 1)
hex (25 26 38 37 29 30 42 41) (4 10 11) simpleGrading (1 1 1)
hex (26 27 39 38 30 31 43 42) (80 10 11) simpleGrading (3 1 1)

hex (4 5 17 16 8 9 21 20) (30 10 11) simpleGrading (0.5 1 1)
hex (5 6 18 17 9 10 22 21) (4 10 11) simpleGrading (1 1 1)
hex (6 7 19 18 10 11 23 22) (80 10 11) simpleGrading (3 1 1)
hex (16 17 29 28 20 21 33 32) (30 4 11) simpleGrading (0.5 1 1)

hex (18 19 31 30 22 23 35 34) (80 4 11) simpleGrading (3 1 1)
hex (28 29 41 40 32 33 45 44) (30 10 11) simpleGrading (0.5 1 1)
hex (29 30 42 41 33 34 46 45) (4 10 11) simpleGrading (1 1 1)
hex (30 31 43 42 34 35 47 46) (80 10 11) simpleGrading (3 1 1)

hex (50 51 52 53 54 55 56 57) martins_extrablock (40 20 20) simpleGrading (1 1 1)

);

patches // keyword
(
patch // patch type for patch 0
inlet1 // patch name
(
(0 12 16 4)
(12 24 28 16)
(24 36 40 28)
(4 16 20 8)
(16 28 32 20)
(28 40 44 32)
) // end of 0th patch definition
patch // patch type for patch 0
inlet2 // patch name
(
//(28 40 44 32)
) // end of 1th patch definition

patch // patch type for patch 1
outlet // arbitrary patch name
(
(3 15 19 7)
(15 27 31 19)
(27 39 43 31)
(7 19 23 11)
(19 31 35 23)
(31 43 47 35)
)

wall Wall
(
(0 1 5 4)
(1 2 6 5)
(2 3 7 6)
(4 5 9 8)
(5 6 10 9)
(6 7 11 10)

(8 9 21 20)
(9 10 22 21)
(10 11 23 22)
(20 21 33 32)
(22 23 35 34)
(32 33 45 44)
(33 34 46 45)
(34 35 47 46)

(36 37 41 40)
(37 38 42 41)
(38 39 43 42)
(40 41 45 44)
(41 42 46 45)
(42 43 47 46)

(0 1 13 12)
(1 2 14 13)
(2 3 15 14)
(12 13 25 24)
(14 15 27 26)
(24 25 37 36)
(25 26 38 37)
(26 27 39 38)

(13 14 18 17)
(17 18 22 21)
(14 26 30 18)
(18 30 34 22)
(25 26 30 29)
(29 30 34 33)
(13 25 29 17)
(17 29 33 21)
)
patch martins_new_inlet
(
(50 51 52 53)
)

patch master
(
(54 55 56 57)
)

wall extraWall
(
(50 54 57 53)
(53 57 56 52)
(51 55 56 52)
(50 54 55 51)
)

);

mergePatchPairs
(
(master inlet1) // merge patch pair 0
);

// ************************************************** *********************** //
Please have a look at the mesh: I generated a new block located in front of your mesh. I added 8 new points for it. The definition of the new block is kept simple, and it has a completely different topology than your original mesh has. Despite of that fact, it can be merged with your mesh!!!

So you can create a cute inlet for your passive scalar, and you don't have to think much about how to combine the inlet block and the rest of your mesh. Just merge them...

By the way: if you don't use it already, try the pyFoamDisplayBlockMesh tool from the pyFoam utility to visualize the blockMeshDict definitions.

I'll build up another example based on your proposed solution...

Martin
MartinB is offline   Reply With Quote

Old   February 8, 2011, 15:53
Default
  #13
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22
MartinB will become famous soon enough
And here is the case:
Have a careful look to the files in 0/*:
The file "T" is prepared for the passive scalar.
The files "U" and "p" got entries for inlet1 and inlet2.

In this case it's not necessary to use mergePatchPairs!

So, let simpleFoam run on this case, and run scalarTransportFoam with the settings from "T" afterwards.

Have fun

Martin
Attached Files
File Type: gz channel_with_element2.tar.gz (3.6 KB, 14 views)
MartinB is offline   Reply With Quote

Old   February 8, 2011, 16:03
Default
  #14
New Member
 
Kristin Kerst
Join Date: Jan 2011
Posts: 11
Rep Power: 15
kriskerst is on a distinguished road
Hi Martin,
thank you.

Actually, I use a ".foam"-file to see the mesh in paraview, but I'll try "pyFoamDisplayBlockMesh tool".
I had the idea to make a mesh like in the sketch:

Okay, actually I try your case ...
Attached Images
File Type: jpg skizze3.JPG (17.9 KB, 16 views)
kriskerst is offline   Reply With Quote

Old   February 8, 2011, 16:30
Default
  #15
New Member
 
Kristin Kerst
Join Date: Jan 2011
Posts: 11
Rep Power: 15
kriskerst is on a distinguished road
Hi Martin,
first the mesh:
I get following error:

PHP Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.5                                   |
|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Exec   blockMesh
Date   
Feb 08 2011
Time   
21:25:26
Host   
hilmar-kersts-macbook-pro-6.local
PID    
1319
Case   : /Users/hilmarkerst/OpenFOAM/hilmarkerst-1.5/run/tutorials/potentialFoam/Einer_bM
nProcs 
1

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time


Reading block mesh description dictionary

Creating block mesh

Creating blockCorners

Creating curved edges

Creating blocks

Creating patches

Creating block mesh topology

Default patch type set to empty

Check block mesh topology

    Basic statistics
        Number of internal faces 
24
        Number of boundary faces 
54
        Number of defined boundary faces 
54
        Number of undefined boundary faces 
0

    Checking patch 
-> block consistency

Creating block offsets

Creating merge 
list .

Creating points

Creating cells

Creating patches

Creating mesh from block mesh

Default patch type set to empty


mergePatchPairs not currently supported.

    
From function blockMesh
    in file genBlockMesh
.C at line 198.

FOAM exiting 
Do I have to change the code?
kriskerst is offline   Reply With Quote

Old   February 8, 2011, 16:42
Default
  #16
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22
MartinB will become famous soon enough
You are using OpenFOAM 1.5 on a Mac, right? Can you upgrade to OpenFOAM 1.6.x or higher? Or do you have a linux machine available?

Martin
MartinB is offline   Reply With Quote

Old   February 8, 2011, 16:54
Default
  #17
New Member
 
Kristin Kerst
Join Date: Jan 2011
Posts: 11
Rep Power: 15
kriskerst is on a distinguished road
Then the case:
blockMesh was okay.
Then I had an error: "keyword is undefined in dictionary "/Users/hilmarkerst/OpenFOAM/hilmarkerst-1.5/run/tutorials/simpleFoam/channel_with_element2/constant/RASProperties"," and so I wrote
"laminarCoeffs
{
}", like in "pitzDaily"
Same for the "wallFunctionCoeffs".

And now I get following error:


PHP Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.5                                   |
|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Exec   simpleFoam
Date   
Feb 08 2011
Time   
21:44:39
Host   
hilmar-kersts-macbook-pro-6.local
PID    
1351
Case   : /Users/hilmarkerst/OpenFOAM/hilmarkerst-1.5/run/tutorials/simpleFoam/channel_with_element2
nProcs 
1

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh 
for time 0

Reading field p

Reading field U

Reading
/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting RAS turbulence model laminar

Starting time loop

Time 
1



Attempt to 
return dictionary entry as a primitive

file
: /Users/hilmarkerst/OpenFOAM/hilmarkerst-1.5/run/tutorials/simpleFoam/channel_with_element2/system/fvSolution::U from line 22 to line 28.

    From 
function ITstreamprimitiveEntry::stream() const
    
in file db/dictionary/dictionaryEntry/dictionaryEntry.C at line 83.

FOAM aborting

#0  Uninterpreted: 0   libOpenFOAM.dylib                   0x00000000000e68f6 _ZN4Foam5error10printStackERNS_7OstreamE + 1238
#1  Uninterpreted: 1   libOpenFOAM.dylib                   0x00000000000e9847 _ZN4Foam7IOerror5abortEv + 471
#2  Uninterpreted: 2   libOpenFOAM.dylib                   0x000000000011d273 _ZNK4Foam15dictionaryEntry6streamEv + 99
#3  Uninterpreted: 3   simpleFoam                          0x0000000000024b03 _ZN4Foam5solveINS_6VectorIdEEEENS_9lduMatrix17solverPerformanceERKNS_3tmpINS_8fvMatrixIT_EEEE + 67
#4  Uninterpreted: 4   simpleFoam                          0x0000000000001ada main + 3130
#5  Uninterpreted: 5   simpleFoam                          0x0000000000000e78 start + 52
Abort trap 
"You are using OpenFOAM 1.5 on a Mac, right? Can you upgrade to OpenFOAM 1.6.x or higher? Or do you have a linux machine available?" Sorry, no other version. I can use a linux earliest on thursday.

But simpleFoam/scalarTransportFoam shouldn't be a problem. It works for me with the blockMeshDic you used and the directories I copied from pitzDaily.
kriskerst is offline   Reply With Quote

Old   July 11, 2012, 15:47
Default
  #18
Member
 
HD
Join Date: Jul 2011
Posts: 56
Rep Power: 15
Rebecca513 is on a distinguished road
Hi Martin,

I am learning OF currently, so I downloaded the file channel_with_element.tar.gz as exercise. I could run it, but the generated pressure field showed some negative values, which shouldn't be the case.

I followed the steps in your post, and I am not sure where I did wrong. If you have any idea what the problems might be, I really appreciate it.

Thank you.

Best,

Hang
Rebecca513 is offline   Reply With Quote

Old   July 11, 2012, 16:13
Default
  #19
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 22
MartinB will become famous soon enough
Hi Hang,

the pressure in simpleFoam is the relative pressure only (because it's an incompressible solver). If you put a fixedValue of 100000 at the outlet patch you will not get negative pressure any more.

Martin
MartinB is offline   Reply With Quote

Old   July 11, 2012, 17:05
Default
  #20
Member
 
HD
Join Date: Jul 2011
Posts: 56
Rep Power: 15
Rebecca513 is on a distinguished road
Hi Martin,

Thank you for your reply. Now I see~

Best,

Hang
Rebecca513 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
[Gmsh] 3D Mesh conversion from gmsh-2.5.0 to OpenFOAM Ancioi OpenFOAM Meshing & Mesh Conversion 17 January 9, 2019 00:50
Identifying Markers in a CGNS Mesh tjim SU2 3 October 12, 2018 02:21
[Other] Mesh Importing Problem cuteapathy ANSYS Meshing & Geometry 2 June 24, 2017 06:29
natural convection in vertical channel Arjun123 FLUENT 11 November 23, 2014 10:09
autoPatch error, mesh quality related...? Alexvader OpenFOAM 0 October 6, 2011 18:57


All times are GMT -4. The time now is 19:04.