CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Parabolic Boundary Condition in OpenFOAM

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

Like Tree7Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 31, 2013, 12:49
Default
  #21
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 129
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Srivaths,

OK, once in possession of source code, it made it a lot easier to figure out the problem. Attached is a working build and loading library, but I have not tested the boundary conditions themselves

So the problem was rather simple:
  1. In "newDirectionMixedFvPatchVectorField.H" you were indicating that definitions for "autoMap" and "rmap" would be given at a later time.
  2. But in "newDirectionMixedFvPatchVectorField.C", you had the code for them commented out.
  3. Result: the library wouldn't load because the aforementioned methods were nowhere to be found and they are needed, given the inherited class structure.
Now, two solutions can be done:
  1. You can comment out the respective code in the header file as well (which I did), since the methods in question were virtual and it's not obligatory in this case to declare them as well in this derived class.
  2. Or you could uncomment the respective code from the ".C" file.
For more information about C++, I advise you to study this tutorial: http://www.cplusplus.com/doc/tutorial/

Best regards,
Bruno
Attached Files
File Type: gz newishBC.tar.gz (3.1 KB, 22 views)
__________________
wyldckat is offline   Reply With Quote

Old   December 31, 2013, 13:27
Default Thank you!
  #22
Senior Member
 
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 14
Sherlock_1812 is on a distinguished road
Hi Bruno,

Thank you so much for clearing that issue!

To be frank I didn't quite understand what autoMap and rmap meant as I was simply doing changes to another derived BC. I have an idea now. I will have a look at the link you have given me and avoid mistakes like them in the future. (hopefully a few others as well)

Wishing you in advance for a Happy 2014! Its almost 00:00 AM here!
wyldckat likes this.
__________________
Regards,

Srivaths
Sherlock_1812 is offline   Reply With Quote

Old   May 22, 2014, 15:46
Default
  #23
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16
babakflame is on a distinguished road
Greetings Bruno

Many thanks for your valuable information in this thread. I found the way in "tutorials/incompressible/simpleFoam/pitzDailyExptInlet"much simpler than groovy.

I want to implement this approach for my case. I have a wedge-typed grid that the inlet velocity profile is known from another simulation.

In the tutorial that you introduced, the velocities are identified for points along the min and maximum Z .

But what about a wedge-typed grid? I have attached a pic of my grid.

In Z direction only one cell occurs. If I define my velocities in Z=0 line, I have the values on cell centers (I think) or do I need to define the velocities on the points located on the upper and lower sides of the triangle?

Does it differ? Would you PLZ hint me?

Best,
Bobi
Attached Images
File Type: jpg inletimage.jpg (13.6 KB, 21 views)
babakflame is offline   Reply With Quote

Old   May 24, 2014, 10:23
Default
  #24
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16
babakflame is on a distinguished road
Greetings Bruno

About the method described in: "tutorials/incompressible/simpleFoam/pitzDailyExptInlet"

I checked that whether I need to determine the velocity profile on the upper and lower sides of the inlet triangle or can I adjust it on the middle of the triangle i.e the location of Z=0

I found out that we can just pre-determine the values of the velocity only on the sides of the boundary. i.e. in my case on the upper and lower sides of the triangle. (for other condition, O.F. did not accept pre-determination of velocity by expressing error)

Many thanks for your kind and always effective hints.

Regards
Bobi
babakflame is offline   Reply With Quote

Old   March 21, 2019, 23:05
Default
  #25
Senior Member
 
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 8
Hgholami is on a distinguished road
Hi wyldckat
I modify transitionalParabolicNonVelocity by replacing
Quote:
vectorField::operator=(n_*curMeanValue*(1.0 - sqr(coord)));
with
Quote:
vectorField::operator=(n_*curMeanValue*(1.0 - pow(coord,2)));
and compile successfully. It work fine. But when I change code to
Quote:
vectorField::operator=(n_*curMeanValue*(1.0 - pow(coord,1.7)));
it compile successfully but in running simulation give error
Quote:
Floating point exception (core dumped)
. Do you any idea for this?
OpenFOAM-ext4.0, solver icofluid of fsiFoam.

Last edited by Hgholami; March 22, 2019 at 00:49.
Hgholami is offline   Reply With Quote

Old   March 24, 2019, 13:54
Default
  #26
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 129
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answers:
Quote:
Originally Posted by Hgholami View Post
Do you any idea for this?
The only thing that comes to mind is to try to use "scalar" to convert the value to actual scalar value type that OpenFOAM and foam-extend use:
Code:
vectorField::operator=(n_*curMeanValue*(1.0 - pow(coord,scalar(1.7))));
Beyond this, I would have to test it myself, but would need to know:
  1. Which installation instructions you followed.
  2. Which Linux Distribution you are using.
  3. A simple test case with which to reproduce the error.


Quote:
Originally Posted by Hgholami View Post
OpenFOAM-ext4.0, solver icofluid of fsiFoam.
Please refer to its actual project name: foam-extend
wyldckat is offline   Reply With Quote

Old   March 24, 2019, 15:25
Default
  #27
Senior Member
 
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 8
Hgholami is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Quick answers:

The only thing that comes to mind is to try to use "scalar" to convert the value to actual scalar value type that OpenFOAM and foam-extend use:
Code:
vectorField::operator=(n_*curMeanValue*(1.0 - pow(coord,scalar(1.7))));
Beyond this, I would have to test it myself, but would need to know:
  1. Which installation instructions you followed.
  2. Which Linux Distribution you are using.
  3. A simple test case with which to reproduce the error.


Please refer to its actual project name: foam-extend

Dear wyldckat
I use linux Ubuntu 16.04 with fsiFoam that downloaded from
https://openfoamwiki.net/index.php/E...re_interaction
the tutorial of hron&Turek that exist in fsiFoam folder is uses and transientParabolicVelocity in src folder of this toolkit modified with pow(a,n) (ex. 0<n<1 or any double value).
I use your recommended code but still the problem exist.
I saw in programmerGuide of openfoam that pow(a,n) work with n=0,1,2,..,4.
Hgholami is offline   Reply With Quote

Old   March 24, 2019, 17:11
Default
  #28
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 129
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quick answer: In the custom code you have, see this line?
Code:
    // Calculate local 1-D coordinate for the parabolic profile
    scalarField coord = 2*((c - ctr) & y_)/((boundBoxMax_ - boundBoxMin_) & y_);
Add this line after that one:
Code:
    Info << coord << endl;
Compile the library again.

Run the case and you should see the list of values for "coord" before it crashes.

See any negative values? If there are negative values, care to guess why the power to 1.7 of a negative value would be a bad idea in the real value spectrum?

If you're not seeing it yet, square root can be defined as a power... "pow(value,0.5)". The cubic root can also be defined as a power: "pow(value,1.5)"

Not seeing it yet? Negative numbers inside root operations will result in imaginary numbers, i.e. not real numbers but instead complex numbers, which is not supported in this particular situation...
Hgholami likes this.
wyldckat is offline   Reply With Quote

Old   March 24, 2019, 23:02
Default
  #29
Senior Member
 
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 8
Hgholami is on a distinguished road
You are right. the (c-ctr) give negative value. By converting negative values to positive values, the problem solved.
Thanks
Hgholami is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ship wave Boundary Condition in OpenFoam keepfit OpenFOAM Running, Solving & CFD 1 May 24, 2012 10:24
asking for Boundary condition in FLUENT Destry FLUENT 0 July 27, 2010 00:55
External Radiation Boundary Condition for Grid Interface CFD XUE FLUENT 0 July 9, 2010 02:53
External Radiation Boundary Condition (Two sided wall), Grid Interface CFD XUE FLUENT 0 July 8, 2010 06:49
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 04:15


All times are GMT -4. The time now is 21:28.