CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Native Meshers: blockMesh (http://www.cfd-online.com/Forums/openfoam-meshing-blockmesh/)
-   -   Channel with vertical element (http://www.cfd-online.com/Forums/openfoam-meshing-blockmesh/84731-channel-vertical-element.html)

kriskerst February 7, 2011 15:56

Channel with vertical element
 
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
(
);

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

MartinB February 7, 2011 17:59

1 Attachment(s)
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

kriskerst February 8, 2011 06:20

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

MartinB February 8, 2011 07:03

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

kriskerst February 8, 2011 09:17

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 February 8, 2011 09:34

1 Attachment(s)
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.:)

MartinB February 8, 2011 10:27

Your static mixer will look great, especially if you make your whole mesh with blockMesh :D

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

kriskerst February 8, 2011 12:14

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

MartinB February 8, 2011 12:37

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

kriskerst February 8, 2011 12:44

Thank you so much and wish you a good evening.

kriskerst February 8, 2011 14:45

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
);

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

MartinB February 8, 2011 15:39

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 February 8, 2011 15:53

1 Attachment(s)
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

kriskerst February 8, 2011 16:03

1 Attachment(s)
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 ...

kriskerst February 8, 2011 16:30

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?

MartinB February 8, 2011 16:42

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

kriskerst February 8, 2011 16:54

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.

Rebecca513 July 11, 2012 14:47

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

MartinB July 11, 2012 15:13

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

Rebecca513 July 11, 2012 16:05

Hi Martin,

Thank you for your reply. Now I see~

Best,

Hang


All times are GMT -4. The time now is 13:21.