# LES Setup of a cyclic channel flow for compressible solver

 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 1, 2022, 15:30 LES Setup of a cyclic channel flow for compressible solver #1 New Member   Philipp Join Date: Mar 2022 Posts: 6 Rep Power: 2 Dear all, i am struggling a bit with the Setup of a rather simple Testcase to evaluate the wall temperature in a channel flow with rhoPimpleFoam as a Large Eddy Simulation. My setup is the following: - 3 dimensional channel with the dimensions: (6*pi*h 2*h 3*pi*h) (streamwise wall-normal spanwise) - A constant heat flux is provided from the wall with the constant heat flux boundary condition - As a fluid i'm using air which is at normal pressure and 300 K at the first timestep (Pr = 0.71) - Cyclic boundary condition in spanwise direction So far i used a Custom Turbulent Inlet Condition for U to generate Turbulence which enters my channel (that worked pretty well). The temperature was set to a fixedValue of 300 K at the inlet. This Case was set up and runs well. Unfortunately i found that due to the limited length of the channel the temperature field does not really show any turbulent fluctuations in the center of the channel (Just for your information i'm using the DNS of Alcántara-Ávila and Hoya, "Direct numerical simulation of thermal channel flow for medium–high Prandtl numbers up to Re τ = 2000" (2021) as a refernce, where they have a fully developed turbulent field in the center of the channel). I want to avoid my computation getting to expensive so my plan is to also use a cyclic boundary condition in streamwise direction. In order to do so i read that i need to use a additional source term for the momentum equation which "keeps my fluid moving through the domain" (sorry for my missing knowledge i'm very new to openfoam). I found different tutorials and also threads in this forum where this is done using the "meanVelocityForce" as a momentum Source in the fvOptions dict. Unfortunately this works only for incompressible solvers and i could not find a solution of adding this momentum Source using rhoPimpleFoam. Does anyone know a way to setup cyclic Boundary conditions in streamwise direction for a channel flow with an compressible solver? A tutorial about a cyclic channel flow i found is this: " The next problem i will be facing is probably the constant heat supply by my heat flux BC which will cause a rising mean temperature in the channel. I found some other threads where this is discussed and an Energy Equation solving for T-T_wall is plugged into the solver it will be only solved for the relative temperature. This is discussed here: Streamwise periodic heat trasnfer and here: Cyclic heat transfer I don't really know if it is possible to use the same approach and define a different Energy Equation in rhoPimpleFoam (espacially as a beginner with very little C++ experience). Maybe someone can give me an estimation on how complicated this would be. But as a first step i would be really happy to set up my channel flow with cyclic boundary conditions. Thanks in advance for your help! Regards, Philipp

 May 25, 2022, 05:03 #2 New Member   Philipp Join Date: Mar 2022 Posts: 6 Rep Power: 2 So in the meantime i have been working on my channel flow a bit and found a setup that works quite well for me and gives me a cyclic channel flow. Maybe this can be helpful if anyone is also a beginner and tries to set up something similar. The mapped boundary condition actually did the job for me. I found another thread where the usage of the boundary condition is explained in detail but unfortunately can't find it now, so i will briefly describe what i did. In the polyMesh dict i set my inlet as a mappedPatch: Code: ```inlet { type mappedPatch; inGroups List 1(mappedPatch); nFaces 680; startFace 100620; sampleMode nearestPatchFace; sampleRegion region0; samplePatch outlet; offsetMode uniform; offset (0.1571 0 0); }``` The offset is the distance to the patch from where i want to map my vaues (in my case this is just the outlet, which is 0.1571 units in x direction from the inlet). Then for Temperature, U, alphat, nut and k in the 0 folder i just used mapped as a inlet condition. An example inlet cond. for U: Code: ```inlet { type mapped; value uniform (0 0 0); interpolationScheme cellPoint; setAverage true; average (6.442 0 0); }``` There was no need for an extra source term in the momentum equation anymore because i used the "average" option as you can see here. I simply set my bulk velocity as an average and measurement of the mass flow indicates that it is constant. However for u i used an internalField from another (precursor) simulation where i used my turbulent inlet condition so i already have turbulence in my domain and do not need to wait until it develops in my channel. This setup works for me, nothing really special here but i was struggling with this a little when i started with OF so maybe it helps someone in the same situation that i was in. Also i needed to reduce my time step a little othewise my simualtion with the mapped BC tended to become unstable which resulted in the typical "negatve initial temperature...." error. For the wall temperature i decided to use a setup where i have one hot wall and one cold wall so i don't have a rising temperature in my channel. Very similar to what Wang and Pletcher did in their paper from 1996 "On the large eddy simulation of a turbulent channel flow with significant heat transfer". They used two different Temperature ratios T_h/T_c = 1.02 and T_h/T_c = 3 . littleJazz likes this.

 October 29, 2022, 04:24 #3 New Member   Jazz Wu Join Date: Aug 2021 Posts: 2 Rep Power: 0 Dear Philipp， Could you show more settings about boundary conditions for T? Thank you so much.