CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Inlet BC for LES (https://www.cfd-online.com/Forums/openfoam-solving/58281-inlet-bc-les.html)

sek October 15, 2007 08:47

I guess, to many of you, this
 
I guess, to many of you, this is a recurring issue with LES involving an inlet boundary. Experience has shown that a reasonably accurate representation of turbulent velocity - with proper statistical correlations - is required at the inlet to guarantee good predicion of the downstream flow. Has anyone tried an inlet velocity B.C. along that line? I have some hands on experience in this issue with FLUENT. Superposing random signals won't wotk. Turbulent (fluctuating) velocity synthesized using varuous techniques might be more useful. One idea is to solve (embed) cyclic boundary problem along with LES. Has anybody tried "recycling" strategy with OF where the instantaneous velocity somehwere in the downstream location is fed to the inlet boundary? I'm interested in learning the mechanics of doinbg that.

grtabor October 15, 2007 09:01

Eugene de Villiers has impleme
 
Eugene de Villiers has implemented this in OF, and it works very well. I've worked with a PhD student in extending what he has done, including feedback control to drive the inlet section towards the desired velocity and turbulence profile - basically you create a body force and/or a velocity correction for the inlet section and make it proportional to the difference between the sampled profile and the intended profile. We are just starting to put together some papers on this - email me if you want and I'll send some preprints.

Gavin

cedric_duprat October 15, 2007 09:35

I want to add that you can fin
 
I want to add that you can find also a hint in the October 11, 2007 http://www.cfd-online.com/OpenFOAM_D...ges/1/311.html
or how to use OF boundary condition to create turbulence inlet field.
and as I understand, the Eugene's code (PerturbU) impose a turbulent field as an initial field but, doesn't prescribe an inlet BC with any turbulence noise in an unsteady run. I hope I'm not wrong :o)
regards,

cedric

PS: Gavin, I'm interresting on your preprints, if you can send me them ... , thank you

grtabor October 15, 2007 09:51

PeturbU is a different code ..
 
PeturbU is a different code .. I think. Eugene did let me have some code which maps from an interior plane back to the inlet, correcting to get a target flux, but I don't know if its distributed generally or if you have to get on to Eugene to get it. Its described in Eugene's PhD thesis.

Cedric - if you let me have your email address I'll email you the papers. My email address is g.r.tabor@ex.ac.uk

Gavin

sek October 15, 2007 10:12

Hearing what's been said so fa
 
Hearing what's been said so far, it appears I need what Eugene put together. I wonder if the code would be made available.

mattijs October 16, 2007 04:01

It is all in 1.4.1. Make the p
 
It is all in 1.4.1. Make the patch a 'directMappedPatch' which requires an additional offset vector where to put the mapping plane.

The patchFields should be of type directMapped.

Attached a simpleFoam case where the inlet is of directMapped type.
http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif pitzDailyDirectMapped.tgz

cedric_duprat October 16, 2007 04:40

Hi all, I would like to add,
 
Hi all,
I would like to add, again, this link : http://www.cfd-online.com/OpenFOAM_D...html#POST13069 about Mattijs upper message.

If I get well, directMapped can exactly do the same as channelOodles + Oodles coupling by an internal plane in the computation of the geometry. It's used to map velocity data and k
Regards,

Cedric

cedric_duprat October 16, 2007 09:44

Hi again, I have questions
 
Hi again,

I have questions on the upper directMapped type:

1- what is the difference between type directMapped and type directMappedFixedValue ?
Because Mattijs, in his attached case use a directMapped type and fixed the value uniform.

2- there is, in this patch, no interpolation. What is the meaning of setAverage. for 0/k, we copy the average of the internal plane in the computation geometry at the inlet ? So, If I plan to do LES, I shouldn't use the average option ?

3- to define the internal plane, we have to set an <offset> which is define, for example by (0 0 1). Is it the coordinates of a point ? if yes, how to define a plan with only one coordinates ?

sorry for these questions, but I'm a little bit slow :o)

regards,
Cedric

mattijs October 16, 2007 14:20

1. Use directMapped for the pa
 
1. Use directMapped for the patchField type (the typeName of directMappedFixedValueFvPatchField).

2. Average scales/offsets the mapped value to maintain some average. E.g. for fixed massflow inlet.

3. offset gets added to all faceCentres on the patch ('inlet' in the sample case) to find the location of the cell whose value to use.

cedric_duprat November 8, 2007 10:40

good afternoon forum, I've
 
good afternoon forum,

I've got one more question about directMappedPatch.
As Eugene said, We can use it for turbulent inlet generator.
In channel_Oodles, we add a source term in our Navier-Stokes equation to balance the wall friction force. Is there some thing like that on the directMappedPatch or not ?
if not, we can add it easly (like in channelOodles) but how to manage the fact that some time you need this source term (in our periodic box) and some time not (in the other part on the geometry) ?
I understand that if you have experimental data, you can compare your compute result with the experimental one and correct with the difference but, if you don't have previous result, you must add some theorical terms.
Then, if you have flow swirling flow, it's more complicate to find the source term (in comparison of channel_Oodles).

Well, these are thursday evening questions,

Cedric D.

mattijs November 8, 2007 14:53

>Is there some thing like that
 
>Is there some thing like that on the directMappedPatch

No, there is only optional averaging. Have a look at updateCoeffs() in finiteVolume/lnInclude/directMappedFixedValueFvPatchField.C.

grtabor November 9, 2007 04:02

Some friday morning answers...
 
Some friday morning answers....

>In channel_Oodles, we add a source term in our Navier-Stokes equation to balance the wall friction force. Is there some thing
> like that on the directMappedPatch or not ?
>if not, we can add it easly (like in channelOodles) but how to manage the fact that some time you need this source term (
>in our periodic box) and some time not (in the other part on the geometry) ?

Construct a mask function with value 1 in the inlet domain and 0 in the problem domain; then multiply the source term in the momentum equation by the mask function.

>I understand that if you have experimental data, you can compare your compute result with the experimental one and
>correct with the difference but, if you don't have previous result, you must add some theorical terms.
>Then, if you have flow swirling flow, it's more complicate to find the source term (in comparison of channel_Oodles).

I think you can do this in a number of ways. We have been able to think of 3 ways of modifying the inlet flow; manipulating the mapped data before reinserting it, introducing a body force into the momentum equation, and introducing a velocity correction to the velocity field in the inlet section. In each case, control algorithms can be used to drive the flow towards the correct result. Thus it is possible to match mean and turbulent velocity profiles very accurately.

Gavin

cedric_duprat November 9, 2007 05:09

Hi Mattijs and Gavin, Thank
 
Hi Mattijs and Gavin,

Thank you for your answers.
For optional averaging, I'm afraid that it will filter the turbulent structure, which it's not the goal in LES calculation. But, your're right, in RANS, it's enought to maintain a constant flow rate in the periodic part.
That's why, I should introduce a body force into the momentum equation. As I said, It's a little bit hard for me to compare with target mean flow but, I am trying to find some theorical sources terms.
For the mask function, of course, you are right.


Thanks again, so now, ... let's do that :o)

Regards,
Cedric

cedric_duprat December 12, 2007 04:35

Good morning Forum, I've go
 
Good morning Forum,

I've got a question about inlet for LES, good thread :o)

I would like to try something different compare to directMappedPatch. which is noise generation.
I know that in OF there is a uncorelated noise generator.
Is there any paper about what is implemented in OF ?

As I understand, we (in fact, Open Foam) add a velocity fluctuation to the mean velocity. So at eatch time step, we generate these fluctuations.
The question now is how to create them ?
So now, we impose inlet (as usual) and the turbulentInlet add the uncorellated fluctuation.

I have a paper from Klein Jou.Comp.Physics 186 (2003) which explain how to make correclated fluctuation. I plan to plug this method in OF, I think a big part is already done but, I've to understand first how it work in OF now.

Regards ,

Cedric

eugene December 12, 2007 07:16

Are you referring to the turbu
 
Are you referring to the turbulentInlet boundary condition?

Basically this is a random walk for each face value on the boundary around some reference value. All the details are available in

src/finiteVolume/lnInclude/turbulentInletFvPatchField.C

Give us a shout once you run in to more specific problems

cedric_duprat December 13, 2007 12:19

thank you Eugene for your answ
 
thank you Eugene for your answer and, you are right, it's not a technical question.
I already look into turbulentInlet but ....I'm not sur to get every thing.
I would like to use the files which are in randomProcesses like turbGen where the fluctuations satistied a given energy spectrum.
and I think, but maybe I'm wrong, that turbulentInlet doesn't used these files. that's why I asked for short idee of how turbulentInlet work.
I just would like to know if I can start for something existing to make my "noise" or if I have to start from zero.


Regards,
Cedric

cedric_duprat January 22, 2008 04:57

Good morning from france, I
 
Good morning from france,

I want to come back on Gavin's answer and the mask function.
I did something like that:
scalar alpha = 0;
label INLET = mesh.boundaryMesh().findPatchID("inlet");
const polyPatch& cellINLET = mesh.boundaryMesh()[INLET];
forAll(cellINLET, INLET)
{ alpha = 1;}
and then corrected the momentum equation.

Now, I need to extract the velocity in the flow direction to calculate the real pressure gradient increment. In channelOodles, the weightedAverage(mesh.V()) refered to all the volume.
I "just" need the volume defined by inlet and the offset defined in my directMappedPatch.
My problem is that in finiteVolume/lnInclude/directMappedFixedValueFvPatchField.C I can't find any way to get the size I want.

I hope someone has an idea ... please ?

Regards,

Cedric

grtabor January 22, 2008 05:11

Since your mask function has v
 
Since your mask function has value 1.0, could you not calculate a weightedAverage of the mask function, then multiply that by the total volume of the mesh to get the volume of the inlet region (which I think is what you are asking for)?

Gavin

cedric_duprat January 22, 2008 06:56

Thank you Gavin for the fast a
 
Thank you Gavin for the fast answer.

It's excactly what I was asking for. I'll try your way which seems to be easier than what I was thinking about.

Cedric

cedric_duprat January 22, 2008 12:36

... It's working, I get a volu
 
... It's working, I get a volume which is different to the total volume.

I've got Vinlet = 0 :o)

Vinlet = toto.weightedAverage(mesh.V()).value()*sum(mesh.V( )).value()

I checked that the sum(mesh.V()).value() is correct.

and here is define my "toto" which is the mask function ... I hope here is also my mistake because I don't know where to look for it.


in createFields.H:
------------------
volScalarField toto
(
IOobject
(
"toto",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("toto",dimensionSet(0, 0, 0, 0, 0, 0, 0),0)
);


in oodles.C:
------------
label patchINLET = mesh.boundaryMesh().findPatchID("inlet");
toto.boundaryField()[patchINLET]=1.0;


I checked the Info<< toto which gives me 0 everywhere except for the inlet patch where it is 1.

Thank you for helping me, or giving me an idea ... again :o)

Regards,

Cedric


All times are GMT -4. The time now is 17:57.