Inlet conditions for cyclic problem

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

 May 18, 2010, 07:42 Inlet conditions for cyclic problem #1 New Member   jan Join Date: Oct 2009 Posts: 6 Rep Power: 8 Hi all, I made a simple application for the calculation of a fully developped flow in a duct. For this, I created a small piece of duct (2D) and coupled the IN and OUT using cyclic boundary conditions (see some of the other threads to know how). This may be a dumb question, but how can I set the bulk velocity of the flow to some constant in this case ? I have the initial conditions set, but it rapidly converges to a 0 m/s flow regime. thanks

 May 18, 2010, 07:57 #2 Senior Member   Stefan Herbert Join Date: Dec 2009 Location: Darmstadt, Germany Posts: 129 Rep Power: 9 Hi fluent145, you are having another problem you might not see at the moment. The pressure field will not be cyclic, when you have some flow. Instead you will have a uniform pressure gradient in your flow direction. Please have a look at openFoam's channelFoam. Its a solver for exactly your problem, handling pressure gradient explicitly. You can set the mean velocity in the domain to the value you want it to be. It's using LES but its not a big deal to make it run with RANS or laminar as well. Good luck, Stefan

 May 18, 2010, 08:31 #3 New Member   jan Join Date: Oct 2009 Posts: 6 Rep Power: 8 Hi Stefan, Thanks for the reply. I already looked at the channelFoam example, but I can't figure out how I have to implement a pressure gradient to my field. In the initial conditions (0.org folder) all parameters (even pressure) are set to cyclic. There is however a p.gr file in the "0" directory which holds some scalar values for pressure (I presume for all cells ?), but is this actually used in the program ? I actually wanted to apply some massflow (say velocity) inlet condition and let the program calculate the pressure drop. This way, it seems I have to work the other way around ?

 May 18, 2010, 10:14 #5 New Member   jan Join Date: Oct 2009 Posts: 6 Rep Power: 8 I don't how I can implement this in my simpleFoam application. Could you maybe tell me step by step how to do this ?

 May 20, 2010, 03:09 #6 Senior Member   Stefan Herbert Join Date: Dec 2009 Location: Darmstadt, Germany Posts: 129 Rep Power: 9 Hi, you can build up your code based on channelFoam. Just replace all the terms related to LES through RANS-Terms. You could have a look at simpleFoam to get the expressions you need. Furthermore, if you want to use SIMPLE instead of PISO you can replace it from simpleFoam, too. You must insert the "-flowDirection * gradP" into your UEqn. Take care that rUA you will need for later correction of gradP is the same as 1.0/AU using SIMPLE. Hope it helps, Stefan

 May 22, 2010, 16:14 #7 Member   David Join Date: Dec 2009 Location: Spain Posts: 61 Rep Power: 8 Hi Herbert First of all, thanks for your attention. Im trying to create a new solver from conjugateHeatFoam, but with the SIMPLE algorithm (for steady state) and adding the ciyclic condition from chanelOodles that allows to fix the average velocity. I have done the first part of my solver: changing the conjugateHeatFoam to SIMPLE algorithm, but when I add the part which calculates the pressure gradient for the cyclic condition I obtain an error due to the class tmp and if I change it to fvVectorMatrix, the "clear" operator for the UEqn.clear(); is not available. The UEqn.clear() is necessary for the SIMPLE algorithm. Do you have any idea? I would really thank you. Regards David Last edited by David_010; May 23, 2010 at 05:53.

 May 25, 2010, 03:11 #8 Senior Member   Stefan Herbert Join Date: Dec 2009 Location: Darmstadt, Germany Posts: 129 Rep Power: 9 Hi David, which error is it that you recieve? If you want to access a member that's not available in tmp but in fvVectorMatrix try UEqn() istead of UEqn when calling this member. Regards, Stefan

 May 25, 2010, 04:04 #9 Member   David Join Date: Dec 2009 Location: Spain Posts: 61 Rep Power: 8 Hi Stefan Thank you very much, it works! Now I have another problem, in the solid region, I want to make periodic the temperature gradient instead of temperature. To do that I have thought in solve the temperature field in the fluid region and the temperature gradient field in the solid region. Then, if the temperature gradient is a variable (e.g GT), I would can apply cyclic conditions. I have change the solveEnergy.H solid equation in the following manner: Code: ``` // Add solid equation TEqns.set ( 1, new fvScalarMatrix ( - fvc::div(GT*fvc::interpolate(DTsolid)) - Q ) );``` where GT is a surfaceScalarField, instead of: Code: ``` // Add solid equation TEqns.set ( 1, new fvScalarMatrix ( - fvm::laplacian(DTsolid, Tsolid) - Q ) );``` but when I try to compile the code, I obtain the error: Code: ```In file included from Prototipe01.C:63: solveEnergy.H: In function ‘int main(int, char**)’: solveEnergy.H:32: error: no matching function for call to ‘Foam::fvMatrix::fvMatrix(Foam::tmp >)’ /home/david/OpenFOAM/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude/fvMatrix.C:323: note: candidates are: Foam::fvMatrix::fvMatrix(Foam::GeometricField&, Foam::Istream&) [with Type = double] /home/david/OpenFOAM/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude/fvMatrix.C:266: note: Foam::fvMatrix::fvMatrix(const Foam::tmp >&) [with Type = double] /home/david/OpenFOAM/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude/fvMatrix.C:235: note: Foam::fvMatrix::fvMatrix(const Foam::fvMatrix&) [with Type = double] /home/david/OpenFOAM/OpenFOAM-1.5-dev/src/finiteVolume/lnInclude/fvMatrix.C:184: note: Foam::fvMatrix::fvMatrix(Foam::GeometricField&, const Foam::dimensionSet&) [with Type = double] make: *** [Make/linux64GccDPOpt/Prototipe01.o] Error 1``` May be it isn't the correct way to do that...I don't know. Anyway, thank you very much for your help. Regards David

 May 25, 2010, 05:30 #10 Senior Member   Stefan Herbert Join Date: Dec 2009 Location: Darmstadt, Germany Posts: 129 Rep Power: 9 Hi David, I think there are several problems. Firstly fvc::div() will return an volField and no matrix. Only fvm::div(DTSolid*GT) will return a matrix. Secondly I don't understand how you are evaluating GT. Are you solving an equation for this field in order to get cyclic boundary conditions involved? And what boundary conditions are you thinking about to apply for Tsolid? Regards, Stefan

 May 25, 2010, 08:47 #11 Member   David Join Date: Dec 2009 Location: Spain Posts: 61 Rep Power: 8 Hi Stefan Thanks for reply. I have to say that I'm using conjugateHeatFoam solver. Because I need to apply cyclic conditions to the temperature gradient and not to the temperature Tsolid (in the solid region), I have created a new variable named GT which I want that it be the temperature gradient (surfaceScalarField) and deleted the Tsolid variable. So I want so solve a equation where the variables will be the temperature gradient GT (in the solid region) and the temperature T (in the fluid region). I don't know if there is any other way to specify a cyclic temperature gradient condition. That would be ideal for me, because the temperature b.c for my solid region (a wall duct) are zeroGradient for the outer wall, coupled with fluid for the inner wall and cyclic gradient for the extremes wall. The last one is the one I unknow. Thanks a lot for your help Regards David

 June 1, 2010, 13:11 #13 Member   David Join Date: Dec 2009 Location: Spain Posts: 61 Rep Power: 8 Hi Stefan Thanks a lot for your help. I still haven't solved the problem. Your suggestion sounds great! but I have two problems: 1. How I can do that? Do you know if there are any tutorial case or anything similar where I can learn it from? 2. The problem is that the solid region has a heat/volume generation, and the temperature increases along the axial tube direction. Then, the temperature in one patch will be higher than in the other patch, and I cannot patch from one to other. The only thing is equal in both patches is the temperature gradient. That is the reason because I cannot apply a simple cyclic condition for the temperature. I don't know if I am explaining it well. For the fluid region I have used the directMapped condition for both temperature and velocity (for the temperature the outlet is zeroGradient and the inlet is directMapped and averaged to 300). But in the solid region I cannot do the same because I unknow the temperature gradient, I only know that it is cyclic. I really appreciate your help. Regards David

 Tags boundary conditions, cyclic

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Saturn CFX 45 February 8, 2016 05:42 Michiel Main CFD Forum 2 June 17, 2012 21:32 cfdmarkus OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 3 August 17, 2011 15:07 phsieh2005 OpenFOAM Running, Solving & CFD 2 August 13, 2009 08:23 Andrew FLUENT 4 May 25, 2004 04:24

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