Time-varying boundary condition
Hello!
I am a new OpenFoam user and I am trying to set up a case with time-dependent boundary condition for velocity. In the tutorial I found something but it's not working.. :( In the "0" folder I wrote the file "U" for velocity specifying the inlet condition : inlet {type uniformFixedValue; uniformValue table ( (0 0) (2.0 1.0) ) } I thought this was the way to say I have a uniform inlet profile which goes from 0 m/s to 1 m/s between time t=0 and t=2, but when I start icoFoam this is what I get: --> FOAM FATAL IO ERROR: Expected a '(' while reading VectorSpace<Form, Cmpt, nCmpt>, found on line 49 the label 0 file: /home/yurifrey/Scrivania/tesi/aorta/0/U.boundaryField.inlet.uniformValue at line 49. From function Istream::readBegin(const char*) in file db/IOstreams/IOstreams/Istream.C at line 94. FOAM exiting Wish someone can help me, thank you very much, Yuri |
Velocity is a vector so table should contain vectors (1 0 0). You put there scalars, and it is the reason for OpenFOAM to complain.
Table should be something like: {type uniformFixedValue; uniformValue table ( (0 (0 0 0)) (2.0 (1.0 0 0)) ) } |
Thank you very much! :)
|
Just another little question.. What if I want the velocity to be directed normal to the boundary, instead of giving the components of the vector? I tried
{type surfaceNormalFixedValue; refValue uniform table ( (0 0) (2 -1) ); } but it's not working.. Thank you again! Yuri |
AFAIK uniformFixedValue BCs are implemented only for limited types of boundary conditions (http://www.openfoam.org/version2.1.0...conditions.php).
Though it is rather simple to implement your own boundary condition. For example you can change surfaceNormalFixedValue. Instead of Code:
class surfaceNormalFixedValueFvPatchVectorField Code:
class surfaceNormalUniformFixedValueFvPatchVectorField |
Hello
I need varying BC for interstitialInletVelocity which can be found in DPMFoam/Goldschemidt. Using table for fixed value: Code:
The default is: Code:
bottom Code:
bottomSB Code:
--> FOAM FATAL IO ERROR: Code:
--> FOAM FATAL IO ERROR: Best, |
Greetings to all!
@Maysam: Unfortunately I don't have enough time to give the whole solution, but I think I can still give information on why that didn't work and what can be done to fix the problem.
Bruno |
Thanks Bruno, Do you know what is the difference between "inletVelocity" and "value" in this BC?
fixedValue and uniformFixedValue value need one velocity but this on needs two. |
Hi Maysam,
Quote:
Bruno |
Hi Bruno,
I know the difference between u and U, the actual and superficial velocity with relation of U=alpha*u. This is the main advantage of "interstitialInletVelocity" to "fixedValue" and "uniformFixedaValue". My question was about why there are two entries in 0/U.air Quote:
|
We want use available boundary conditions of fixedValue (BC1), uniformFixedValue (BC2) and interstitialInletVelocity (BC3) to write own myInterstitialInletVelocity (BC4).
BC4 will have advantages of BC3 (which accounts alpha to have constant mass flow rate in multiphase flows) and BC2 (which accepts table to apply time varying air velocity). The first step is compiling BC in user directory. 1- Copying BC3 from source to user directory and renaming it to my0InterstitialInletVelocity. Code:
$FOAM_SRC/finiteVolume/fields/fvPatchFields/derived/interstitialInletVelocity 3- Writing an appropriate Make/files and options and then compiling it in: Code:
$WM_PROJECT_USER_DIR/src/finiteVolume/ Code:
libs ("libmyFiniteVolume.so"); The link of GoldschemidtBC contains my0InterstitialInletVelocity BC in 0/U.air and dictionary in it is controlDict. The src link contains BC1 to BC4. but is compiled for "my0InterstitialInletVelocity". The BC4 doesn't work which will be discussed later. Code:
https://www.dropbox.com/s/b54r786b167bmxw/src.tar.gz?dl=0 The next step is doing modification in myInterstitialInletVelocity (BC4) to possible accepting table. The difference of BC2 to BC1 are: 1- BC2 has a new parameter definition: Code:
const Field<Type>& fld Code:
uniformValue_() 2- BC1 uses mapper (which I don't know what does it do): Code:
fixedValueFvPatchField<Type>::fixedValueFvPatchField Code:
template<class Type> 3- we see time again in next class. In this one, it is looking for value or table: Code:
template<class Type> However, I tried many different tries and errors by adding classes to BC4 but not possible to compile it successfully. Two possibles for errors are: 1- mistakes in defining parameters 2- two "operator== ..." in updateCoeff of BC4: Code:
void Foam::myInterstitialInletVelocityFvPatchVectorField::updateCoeffs() Sorry for this long post and thanks in advance for any suggestion. |
Hi all,
I am trying to write a time varying boundary condition which accounts inlet porosity in applying inlet velocity but it hasn't lead to solution yet. Is it possible to write a script which automatically do below procedure: 1- Run 2- After finishing run (reaching to endTime) do the following: 2-1- Iincrease endTime in system/controlDict (for example from 1 to 2) 2-2- Change inlet velocity in U.air file (with known line and column) in exist latest time folder. 3- Run again and do a loop from 1 to reach a desired time (for example 10sec). For this purpose we should have a script to: 1- change a number in a file 2- understand when the run is finished 3- loop over time I think the first one is possible but I don't know about 2 and 3. Any idea will be appreciated. |
Why don't you use groovyBC for your custom boundary condition?
You seem to be making it a lot more complicated than what it really is, search for groovyBC I'm sure it will help you. |
Quote:
This is what exactly I need for finding minimum fluidization velocity. I need a gradually increase in fluidization velocity. I used table with fixed value but the results was mistake because of inlet porosity is not considered in fixedValue. Did you find any solution? Please share it if you have found. Best regards. |
Quote:
The type of boundary condition is interstitialInletVelocity which divide velocity over air volume fraction. The groovy doesn't see volume fraction and is suitable for fixed value types. If I'm wrong, please correct! Quote:
As you mentioned, gradually increase of velocity is crucial for any fluidizeation velocity simulation. But unfortunately I didn't find any solution yet :( |
Thanks Bruno for merging these threads.
If anyone has any Idea for first (BC4) or second (script) way it will be appreciated to share with others. Regards, |
As far as I'm concerned, you can access volume fraction and all the variables you want from groovyBC.
|
Greetings to all!
@Maysam: I didn't manage to have enough time to fully test this, so please test if everything is working OK. The new boundary condition, use/build instructions and tutorial cases are provided here: https://github.com/wyldckat/Unsuppor...OpenFOAM-2.3.x Either use "git clone" or download as a ZIP file, as instructed on the right side of the page at that website. By the way, the main detail was that the method "updateCoeffs()" should be like this: Code:
void Foam::uniformInterstitialInletVelocityFvPatchVectorField::updateCoeffs() Best regards, Bruno |
Hi Bruno,
Thank you very much for spending your valuable time on this issue. I checked. it works perfect. Best regards, |
Hi Maysam,
Just a side note: Sorry, I wasn't very clear on why I mentioned it took me 2 hours. My estimate is that on average it takes me 20 minutes to answer each question here on the forum, although finding/developing the answer can sometimes take 6 to 8 hours or more... so the average comes down only because there are several posts where the answer ends up being a questions. Therefore, the concept I had in mind when I said "2h" was that it was all of the time I had that day and that compared to the average it was 5 other posts I couldn't answer... I wasn't trying to show off "how good I am", I was actually trying to state that I'm not good enough to answer as fast as I wanted to be able to :( This to say: If you - and anyone reading this post - can find some time to help other newcomers on the forum, please do! Best regards, Bruno PS: I'm very glad it's working!! |
All times are GMT -4. The time now is 15:01. |