|
[Sponsors] |
September 27, 2010, 08:31 |
Defining elementwise boundary conditions
|
#1 |
New Member
Daniel
Join Date: Sep 2010
Posts: 10
Rep Power: 16 |
Hi everybody,
I've got a complete mesh from a postprocessor and want to define boundary-conditions elementwise in my OpenFoam-case. How defining boundary-conditions works on boundarys like walls is clear to me, but what if I want to assign a special temperature on every surface-node of my model? I now the node numbers (let's say from 1 to 200) and values for every node. How would that look like or would I need to define a seperate boundary for every element and then define the values for every "boundary"? Thank you very much for every kind of help! |
|
September 27, 2010, 12:58 |
|
#2 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
By "surface" you mean all the interior faces? So you basically want a constant surfaceScalarField? You can define one in your createFields.H... but I'm not sure what you plan to do with it.
|
|
September 28, 2010, 03:57 |
|
#3 |
New Member
Daniel
Join Date: Sep 2010
Posts: 10
Rep Power: 16 |
Hi marupio,
thats not directly what i'd want to do. I've got, just for the example, some sort of box with hexa's in the volume surrounded by shell elements that form the surface of the box. Now i would like to give every shell-element a specified temperature which I get really exact from measurements. So I'd like to tell OpenFoam that shell #1 --> 387.98 K shell #2 --> 388.23K shell ... Any Idea? |
|
September 28, 2010, 08:56 |
|
#4 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
Why can't you use a fixed value boundary condition?
|
|
September 28, 2010, 09:33 |
|
#5 |
New Member
Daniel
Join Date: Sep 2010
Posts: 10
Rep Power: 16 |
Hi Marupio,
I could for sure take a fixed value boundyry condition, but I think I'd need a new Boundary for each single shell element? At the moment my boundary-conditions look like Code:
boundaryField { Bottom { type timeVaryingUniformFixedValue; fileName "temperature_floor.dat"; outOfBounds clamp; } Side1 { type timeVaryingUniformFixedValue; fileName "temperature_walls.dat"; outOfBounds clamp; } side2 { type timeVaryingUniformFixedValue; fileName "temperature_walls.dat"; outOfBounds clamp; } .... |
|
September 28, 2010, 10:36 |
|
#6 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
Maybe I don't understand what you want to do... but fixed value boundary conditions don't have to be uniform. You can define the distribution of values across each surface. You are using a time varying boundary condition - but the values don't change over time? Are you using this because it assigns a different value to each face element by reading from the dat file?
|
|
September 28, 2010, 10:56 |
|
#7 |
New Member
Daniel
Join Date: Sep 2010
Posts: 10
Rep Power: 16 |
Oh, ok, now were getting closer I think.
I think I don't know to much about this so my question may be somehow unclear. Lets take a surface from my model, for example the Bottom. At the moment I'm assigning a time-varying temperature to the whole bottom, what looks like this inside the "temperature_floor.dat" file: Code:
( (0.0 900.000) (200.0 900.000) (230 300.000) ) Now I'd like to define Element 1000 to go from 901.5 over 902.3 to 302.58 K Element 1001 to go from 902.5 to 903.1 to 301.1 K Element 1002 to go from 900.00 to 908.456 to 320 K I could for sure also manage to get coordinates where I'd like to define the Temperature (the coordinates from the single Elements). How would you do this? I've never seen how I can define a Temperature distribution across a surface... And I can't find anything about that... |
|
September 28, 2010, 12:10 |
|
#8 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
I don't have my OpenFOAM pc with me today, so I'm going mostly from memory...
I don't know much about the timeVaryingBoundaryCondition - if it can handle a non-uniform surface, and how to format the data file for that. I know it uses interpolationTable: http://openfoamwiki.net/index.php/Op...rpolationTable Look at the 0/T file, you'll notice the internalField is (probably) defined as a uniform value: Code:
value uniform 273.12; The same goes for boundary conditions. Either you can give it a uniform value, or you can give it a list. "uniform" is just a shorthand. Each value in the list corresponds to the face number on that boundary patch. The tricky part is associating the face number with physical coordinates. If you really only have 4 face elements, then you can probably get away with figuring it out by hand. Otherwise, I strongly recommend funkySetFields: http://openfoamwiki.net/index.php/Co...funkySetFields Returning to the timeVarying boundary condition - try to find an existing example that uses a timeVarying boundary condition... that's all I can suggest for that. -dave |
|
October 19, 2010, 05:28 |
|
#9 |
New Member
Daniel
Join Date: Sep 2010
Posts: 10
Rep Power: 16 |
Hi,
I've made a short script that generates my Boundary-Condition elementwise. The resulting File for "T" looks like: Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.6 | | \\ / A nd | Web: http://www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 1 0 0 0]; internalField uniform 700; boundaryField { Inlet { type fixedValue; value uniform 350; } outlet { type zeroGradient; } Interface { type fixedValue; value nonuniform List<scalar> 22810 ( 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 280 ... ) } } Code:
--> FOAM FATAL IO ERROR: ill defined primitiveEntry starting at keyword 'value' on line 35 and ending at line 22854 file: .../Dice/0/T at line 22854. From function primitiveEntry::readEntry(const dictionary&, Istream&) in file db/dictionary/primitiveEntry/primitiveEntryIO.C at line 214. FOAM exiting |
|
October 19, 2010, 05:39 |
|
#10 |
Senior Member
Join Date: Mar 2009
Posts: 225
Rep Power: 18 |
I'm not sure, but shouldn't you use 'internalField' instead of 'value'?
|
|
October 19, 2010, 06:23 |
|
#11 |
New Member
Daniel
Join Date: Sep 2010
Posts: 10
Rep Power: 16 |
Hi,
well, I think this should be right, as this isn't the definition for the internal field but for the boundary field. For mut (for example) this looks like: Code:
InnerBoxSurface { type mutkWallFunction; Cmu 0.09; kappa 0.41; E 9.8; value nonuniform List<scalar> 4154 ( 6.5313e-06 0 0 0 0 0 0 ... I thought I could simply define this like this as for alphat OpenFoam itself defines alphat and mut this way... |
|
October 19, 2010, 06:29 |
|
#12 |
New Member
Daniel
Join Date: Sep 2010
Posts: 10
Rep Power: 16 |
Oh, I just found the solution:
after the elementwise-definitions and the closing bracket ")" I was missing an ";" |
|
November 24, 2010, 05:50 |
|
#13 |
New Member
Daniel
Join Date: Sep 2010
Posts: 10
Rep Power: 16 |
Hi there again,
with all that above working, I got quite far, but now I'd really need some sort of element-wise boundary condition that is time-varying. What I know is how I can do Elementwise-Boundary-Conditions. Also I know how to define time-varying boundary conditions for complete patches. Now the question is how it would have to look like If I wanted to combine these two. Would I need to generate a patch for every single element and than define time varying boundary conditions in a way like boundaryField { FirstFace { type timeVaryingUniformFixedValue; fileName "FirstFace.dat"; outOfBounds clamp; } SecondFace { type timeVaryingUniformFixedValue; fileName "SecondFace.dat"; outOfBounds clamp; } ... But this looks quite not-staight forward... Is there any possibility of doing this somehow more easily? Something like defining two values in the nonundiform list for each Boundary-Surface-Element? My hope would be that the first value would be interpreted as value for start time of the calculation and the second one as end time-value or something like this. Between the two there should be something like linear interpolation of the values. Also defining values for defined times of the simulation would be fine. Whatever, you see I'm really lost in this thing. Thanks for any kind of help! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Impinging Jet Boundary Conditions | Anindya | Main CFD Forum | 25 | February 27, 2016 13:58 |
non reflective boundary conditions for incompresible flow | Pascal_doran | OpenFOAM Programming & Development | 16 | August 25, 2015 06:35 |
[Netgen] boundary conditions and mesh exporting | vaina74 | OpenFOAM Meshing & Mesh Conversion | 2 | May 27, 2010 10:38 |
Update boundary conditions calculated by an external program | CedricVH | OpenFOAM | 2 | January 15, 2010 12:55 |
A problem about setting boundary conditions | lyang | Main CFD Forum | 0 | September 19, 1999 19:29 |