|
[Sponsors] |
April 10, 2009, 10:54 |
Addition of a New boundry Condition
|
#1 |
New Member
Nadeem
Join Date: Mar 2009
Location: München, Bavarian, Deutschland
Posts: 24
Rep Power: 17 |
Hi friends,
I want to introduce a new condition in the file which has the following link. src/finiteVolum/fileds/fvPatchFields/derived/oscillatingFixedValue if you go to the file OscillatinFixedValueFvPatchField.c you will see that it calculates the frequency value by the following formula 1.0 + amplitude_* sin(2*mathematicalConstant:i*frequency_*this->db().time().value()); actually i want to introduce the angle theta as a phase angle into the above formula, I am new into C++, could you guys give me tips how could i proceed it. Thanks a lot. Regards |
|
April 22, 2009, 06:42 |
|
#2 | |
Member
Björn Fabritius
Join Date: Mar 2009
Location: Freiberg, Germany
Posts: 31
Rep Power: 17 |
Quote:
If your theta is just a phase shift, simply add it inside the sin() function: Code:
sin(theta+2*mathematicalConstant::Pi*frequency_*this->db().time().value()); Just take a look at amplitude_ and copy it's behaviour, just changing the name of the variable to theta_ for example. Have fun, Bjoern PS: To get the hang of C++, I recommend the book "The C++ Programming Language" by Bjarne Stroustrup. Or check out the great tutorial at http://www.cplusplus.com/doc/tutorial/ |
||
April 22, 2009, 13:06 |
Boundry Condition
|
#3 |
New Member
Nadeem
Join Date: Mar 2009
Location: München, Bavarian, Deutschland
Posts: 24
Rep Power: 17 |
Dear bfg,
I did it the same way, as you have mentioned. after doing these changes. I wrote the "wmake libso" command in the directory of the finitevolume, and the compiler has created the .so file, and at last i also compiled the rhoTurbFoam file. But when i used the rhoTurbFoam to solve my case, it created two more folders named 0.200 and 0.400 (according to the times). In my 0.00 folder, i have added another term that is "angle" after frequency in the U file, but i didnt get the term "angle" in the U file in the folder 0.200. there is no error, but on execution, the compiler, is not giving the output. I dont know whats the problem. May be I am doing a simple mistake that I cannot find it out. Please help me out. Actually, this is my semester project and it is taking too much time now. Thanks a lot for co-operation. Best Regards, |
|
July 24, 2009, 15:00 |
|
#4 |
Senior Member
isabel
Join Date: Apr 2009
Location: Spain
Posts: 171
Rep Power: 17 |
Sorry for bother you. Do you know how to correct my error?
My code is: forAll(levelSet,gI) { if (levelSet[gI] > 0.0002 ) H[gI] = 1; else { if (levelSet[gI] < 0.0002 ) H[gI] = 0; else H[gI] = sin(levelSet[gI]); } } And when I compile, I have this error in the line " H[gI] = sin(levelSet[gI]) " : levelSetEqn.H:91: error: call of overloaded ‘sin(double&)’ is ambiguous |
|
July 24, 2009, 15:11 |
|
#5 |
Senior Member
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18 |
Isabel,
try Foam::sin(levelSet[gI]) Henrik |
|
July 24, 2009, 15:19 |
|
#6 |
Senior Member
isabel
Join Date: Apr 2009
Location: Spain
Posts: 171
Rep Power: 17 |
Thank you very much, Henrik
Now it works. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
unsteady state inlet boundry condition | shubham | FLUENT | 3 | March 1, 2009 09:34 |
boundry condition problem | kamal | FLUENT | 3 | June 18, 2008 03:35 |
How to model a different boundry condition | prateek jain | CFX | 2 | May 24, 2007 07:43 |
wall boundry condition | fred | FLUENT | 0 | August 19, 2004 13:10 |
Temperature rise at a boundry condition | Rodrigo | FLUENT | 5 | August 3, 2001 11:04 |