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

Time varying far field boundary conditions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 15, 2022, 09:18
Default Time varying far field boundary conditions
  #1
Member
 
Anders Aamodt Resell
Join Date: Dec 2021
Location: Oslo, Norway
Posts: 64
Rep Power: 4
ander is on a distinguished road
Dear SU2 devs,

I'm trying to modify the source code to account for time varying far field boundary conditions for the Euler Equations. (In the future I would also like to extend them to vary spatially, but this is a first step).

I have modified the function CEulerSolver::BC_Far_Field, and the edited piece of the code looks like this:

Code:
      bool UsingTraject = config->UsingTrajectory();
      Vel2_Infty = 0.0; Vn_Infty = 0.0;
      for (iDim = 0; iDim < nDim; iDim++) {
          Vel_Infty[iDim] = UsingTraject ? config->GetVelocityFS_Traject(iDim) : 
          GetVelocity_Inf(iDim);
          Vel2_Infty     += Vel_Infty[iDim]*Vel_Infty[iDim];
          Vn_Infty       += Vel_Infty[iDim]*UnitNormal[iDim];
      }
      Density_Infty = UsingTraject ? config->GetDensityFS_Traject() : GetDensity_Inf();
      Pressure_Infty   = UsingTraject ? config->GetPressureFS_Traject() : 
          GetPressure_Inf();
      SoundSpeed_Infty = sqrt(Gamma*Pressure_Infty/Density_Infty);
      Entropy_Infty    = pow(Density_Infty, Gamma)/Pressure_Infty;
Here I have added some additionals values and functions to CConfig. The bool UsingTraject specifies if the time varying conditions are used. The functions Get_XXX_FS_Traject() reads in time varying free stream values from the config file, and these free stream values are updated once each timestep.

However my implementation doesn't seem to work. I have ran a supersonic case on a wedge-like object where I gradually changed the direction of the freestream velocity, but the incoming field doesn't seem to change direction.

I would like some guidance on possible reasons for why my implementation is failing. Is there is something wrong in my assumption that I can modify the BC_Far_Field function in this way?

Thanks in advance!

Last edited by ander; November 15, 2022 at 12:40.
ander is offline   Reply With Quote

Old   November 16, 2022, 17:55
Default
  #2
Senior Member
 
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 504
Rep Power: 17
bigfootedrockmidget is on a distinguished road
Did you check that the farfield changes if you change the farfield velocity from the config file? And what if you just hardcode some value for the farfield conditions in the farfield function?

Did you check that you are actually entering the farfield routine every timestep?
bigfootedrockmidget is offline   Reply With Quote

Old   November 17, 2022, 14:02
Default
  #3
Member
 
Anders Aamodt Resell
Join Date: Dec 2021
Location: Oslo, Norway
Posts: 64
Rep Power: 4
ander is on a distinguished road
You are correct, they didn't change! The reason was that I updated the config file only on the MASTER rank, and therefore all the different copies of the config file didn't change.

I tested it now, and if I make the velocity field accelerate linearly and apply the same acceleration as a body force, the velocity field seems to get a uniform acceleration, which was what I hoped (at least in the supersonic case).

I need to do more testing to see if I am able to implement far field BC's for a rotating reference frame
ander is offline   Reply With Quote

Old   November 17, 2022, 15:57
Default
  #4
Senior Member
 
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 504
Rep Power: 17
bigfootedrockmidget is on a distinguished road
Great to hear!
By the way, there is also the option to use the python wrapper to implement this, you can have a look in Testcases/py_wrapper for some examples.
bigfootedrockmidget is offline   Reply With Quote

Reply


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
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 04:13
[swak4Foam] swakExpression not writing to log alexfells OpenFOAM Community Contributions 3 March 16, 2020 18:19
My radial inflow turbine Abo Anas CFX 27 May 11, 2018 01:44
CFD analaysis of Pelton turbine amodpanthee CFX 31 April 19, 2018 18:02
Radiation interface hinca CFX 15 January 26, 2014 17:11


All times are GMT -4. The time now is 08:56.