TimeVaryingMappedFixedValue for Direct Numerical Simulation inlet
I want to compute a Direct Numerical Simulation of a turbulent channel flow perturbed by an obstacle. I use two different channels to this end: a turbulent precursor channel with periodic boundary conditions and a fixed mean pressure gradient in which I sample velocity profiles, as portrayed in this schematic http://img689.imageshack.us/img689/8...nfignum.th.png (sorry for the French caption, I hope you get the idea). Those profiles are then used as inlet boundary conditions (TimeVaryingMappedFixedValue) of another channel containing my perturbator. From now on, I will call my periodic turbulent channel precur, and the perturbed channel perturb.
To achieve this, I sample the velocity field on a plane, in precur, using a method similar to the one found in http://www.cfd-online.com/Forums/ope...ngplane-3.html, that is, I first define a sampling plane:
The file containing the cell centers is slighty modified: the value of x is changed to coincide with the value of x at the inlet of the perturb.
The U profiles files are reformated from vectorField to vectorAverageField as needed by TimeVaryingMappedFixedValue (the value (0 0 0) is used for the average, as setAverage is disabled when the boundary condition is used) by a script. The rest of the profiles is left unchanged. All the files are then transfered to the directory constant/boundaryData/inlet of the channel with the perturbator.
The main problem is that when I put probes in the sampling plane in the precursor channel and on the inlet patch (manually created by finding the closest cells for the precursor, and face for the inlet, getting its index number and then exporting the value at each timestep), at the same y and z coordinates, I expect to see the same signal, but I don't. Here is the signal in the sampling plane: http://img28.imageshack.us/img28/715...eprecur.th.png, and here is the corresponding signal at the inlet condition: http://img691.imageshack.us/img691/5...rbinlet.th.png. The values are very different: the probe at the precur starts at 1.5, while the probe at the perturb start at nearly 0.135, which corresponds to bulk temperature prescribed in the precur.
If, for a given timestep, I compare the sampled velocity fields in the precursor using Paraview (instead of the sampling method described above), with the field used at the inlet, I observe two very different fields, while expecting the same. On this figure: http://img684.imageshack.us/img684/8...rofiles.th.png, the backward profile corresponds to the profile applied by timeVaryingMappedFixedValue, while the profile frontward corresponds to the profile sampled by Paraview at the same time step (after 500 iterations). The inlet profile seems more smooth.
Aside from those problems, the boundary condition seems to be working: here we can see the continuity between the inlet profile and the internal velocity field: http://img576.imageshack.us/img576/5...urb1002.th.png. It is just that the turbulent profiles do not correspond to the turbulent profiles used. And I don't know where the one I see at the inlet come from.
I am using OF-1.5, and made tests with the latest 1.5-dev to check if the problems came from outdated sources, but I obtained the same results.
I would like to know if somebody could help me diagnose my problem ?
When I activate the debug flag for timeVaryingMappedFixedValue, I get the following output:
I have solved my problem. Part of my codes were bugged. Once everything was settled, I had this comparison between the sampled plane and the inlet flow: http://img692.imageshack.us/img692/5...bprecur.th.jpg
Which is what is to be expected !
I was just wondering if you would mind posting the code that you used to take your recycled inlet to feed downstream flow.
I read through the thread you cited and tried the code you mentioned, but I am new to openfoam and objective c. It seems the first error I am running into is with the
line, which I put just before my
line. I get the error shown below. My interpretation of it is that "subsetter" is not properly defined. how do I define that?
The problem I am trying this out on is a tube flow that feeds another tube flow. Ideally, I would try and get the cut plane in the boundaryData format (foamFile?) straight out of the solver.
pisoFoam_bodyForce_samp.C: In function ‘int main(int, char**)’:
pisoFoam_bodyForce_samp.C:54: error: ‘subsetter’ was not declared in this scope
pisoFoam_bodyForce_samp.C:56: error: expected ‘;’ before ‘while’
pisoFoam_bodyForce_samp.C:42: warning: unused variable ‘samplingCount’
/opt/openfoam170/src/finiteVolume/lnInclude/initContinuityErrs.H:37: warning: unused variable ‘cumulativeContErr’
pisoFoam_bodyForce_samp.C:229: error: expected ‘}’ at end of input
make: *** [Make/linux64GccDPOpt/pisoFoam_bodyForce_samp.o] Error 1
Why not just put both domains in the same case and use directMapped B.C.?
I'm doing similar job with yours, would you mind sharing your detailed procedures of mapped velocity of every time step of turbulent precursor channel to another channel containing my perturbator?
|All times are GMT -4. The time now is 12:35.|