CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Mapping Boundary Conditions to Another Case (https://www.cfd-online.com/Forums/openfoam/75434-mapping-boundary-conditions-another-case.html)

jordan April 26, 2010 01:19

Mapping Boundary Conditions to Another Case
 
I am setting up a case to simulate flow in an rectangular cross-section, s-shaped duct using OF1.6 . The flow is turbulent(Re 40 000), and I am trying to reduce computational time in two ways. First, I would like to run the case in parallel and second I would like to reduce the inlet length(and mesh size) and be certain that I have fully developed flow as my inlet boundary condition. To accomplish this I have considered using the directMappedPatch technique, and I have created a case for a simple straight duct. As far as I can tell, this technique does not work correctly in parrallel cases though(reconstructPar fails.) I have tried to use the manual decomposePar method to enusre that the directMapped patch's exist in all processor cases. I used the hierarcichal method and selected 1 processor in the mapped direction, reconstructPar still tells me it can't find the region0.

Code:

Did not find sample (0.15 0.00152006 -0.0393227) on any processor of regionregion0

    From function directMappedPatchBase::findSamples(const pointField&, labelList&, labelList&, pointField&)
    in file directMapped/directMappedPolyPatch/directMappedPatchBase.C at line 337.

FOAM exiting

As an alternative, I would like to use the flow at the outlet of the straight duct as an inlet boundary condition for my larger case. Is there a boundary condition that will let me map the conditions at a patch in one mesh to a patch in another? I have seen a method that uses a list of points, and the various field values at each point, but extracting all of the data seems to be a lot of work. I have purposely created the mesh of the straight duct to ensure that there will be a one to one mapping between the cells on the faces of both cases.

I have a feeling that this should be possible, but there is something I am not quite getting. Hopefully someone can provide me with some advice.

Cheers

Jordan

Gearb0x May 12, 2010 17:02

Hi

I'm in the same situation as you...

Did you figure out how to solve your problem?

Thanks for the help!

jordan May 12, 2010 17:53

Sort of solved.
 
I guess I am guilty of the same behaviour that many others must be. That is, they solve their own problems, and then never share. Rather then post frustrating "I got it" response that some do, I will briefly explain my approach.

I did in fact use the DirectMapped patch to create a case representing fully developed flow; however, I chose to use a non fully developed inlet condition instead. In either case, it will work. If you do some reading about the DirectMapped patch, you'll see that it basically creates an infinite length domain. It is important that you offset the patch enough that you will see the correct length scale turbulent structures developing. I'm not an expert, but I believe this should be related to the hydraulic diameter of the duct.

To map the result, you simple use the mapFields tool. In this case the mesh is probably not consistent, so you need a dictionary file for the tool. In the dictionary, you can specify how the patches should be mapped between the cases. If you only need to map one patch from the source to the destination, then only list that mapping. This will allow you to say map the outlet patch from one case, to the inlet patch of another.

I'm sorry that I don't have time to give you an explicit example. I hope this little bit of guidance helps you out. I was able to find all of the information I needed for the mapFields tool in the tutorials. I believe I read the source documentation for the directMapped patch type to understand how it works. There should be some information on these forums as well. You should keep in mind that the directMapped patch does not appear to work for parallel cases. I didn't dig very deep into that problem, but I don't think there is a simple solution. Good luck.

Gearb0x May 12, 2010 18:00

Dear Jordan,

Thanks for the answer

In fact I have used several options and none of them worked.

What I have is a U turn and I would like to start from a non fully developped flow to match an experiment I'm conducting. Apparently this is what you did too.

The problem I have for mapfield is like this :
BC : inlet : Ugiven, k and espilon given, p zerogradient nut calculated
outlet : pressure given, k epsilon U zerogradient, nut calculated
walls : 1e-06 for k,epsilon, zerogradient p, zero for U (I'm using laundersharmaKE so I need "zero" conditions for k and espilon)

if I make the a simple channel (straight one) the length I need for my field, I have strange outlet flow profile, very different from what I get if I make my U turn with a longer "leg" to have the "true" developped flow.

Could you explain me how did you manage to get a non fully developped flow with the directMapped boundary condition?

Thanks again for the the help.

jordan May 19, 2010 12:51

Sorry to take so long to respond, I've been out of town for a while. As I said in my post, you'll only get the fully developed condition if you use directMapped. To setup my inlet condition, I made a domain that was longer than required, determined how much length was needed to achieve the appropriate amount of boundary layer development. I then shortened the inlet domain to this length and mapped the outlet of the solved inlet domain to the inlet of my problem domain(mapFields). Good luck.

Jordan


All times are GMT -4. The time now is 09:02.