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

Rotating detonation simulation覧boundary setting

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 5, 2022, 09:16
Post Rotating detonation simulation覧boundary setting
  #1
New Member
 
Join Date: May 2022
Posts: 2
Rep Power: 0
studentchen is on a distinguished road
Dear friends,
I am doing 3D rotating detonation simulation,the difficulty is the inlet boundary depends on different pressure:

when pw > p0, the reactants can not be injected into the chamber.
when p0 >pw > pcr, the inlet flow is not choked,completes subsonic injection.
when pw < pcr < p0,it is a sonic injection .

I hava used groovyBC of swak4Foam,but the results is bad.

Could anyone give me some advices and help?

Thanks very much!
studentchen is offline   Reply With Quote

Old   April 21, 2024, 18:17
Default
  #2
New Member
 
can
Join Date: Aug 2023
Posts: 4
Rep Power: 2
homeros is on a distinguished road
#include "udf.h"
DEFINE_PROFILE(my_pressure_inlet_mf,thread,i)
{

face_t f;
cell_t c0;
Thread *tc0;

real p;
real po;
real pcr;
real To;
real gamma;
real R;

R = 368.9; // J/kg k
gamma = 1.29;

po = 1000000;
pcr = po * pow( (2/(gamma+1)), (gamma/(gamma-1)) );
To = 300;

begin_f_loop(f,thread)
{
c0 = F_C0(f,thread);
tc0 = THREAD_T0(thread);
p = C_P(c0,tc0); //pressure near wall

if(p >= po) // where boundary is gonna be set as wall
{
F_PROFILE(f,thread,i) = 0.0000001; // no source term case
F_U(f,thread)=0;
F_V(f,thread)=0;
F_W(f,thread)=0;
}

else if(p > pcr && p < po)
{
F_PROFILE(f,thread,i) = p;
F_U(f,thread) = sqrt( (2*gamma/(gamma-1)) *R*To * (1 - pow(p/po, (gamma-1)/gamma)) );
F_T(f,thread) = To*pow( p/po, (gamma-1)/gamma);
}

else if(p <= pcr)
{
F_PROFILE(f,thread,i) = pcr;
F_U(f,thread) = sqrt( (2*gamma/(gamma-1)) *R*To * (1 - pow(p/po, (gamma-1)/gamma)) );
F_T(f,thread) = To*pow( p/po, (gamma-1)/gamma) ;
}

}
end_f_loop(f,thread)

}

You can change parameters. This is an udf for fluent btw.
homeros 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
Inertial and non-Inertial Reference Frame for Rotating Flows emreozmen Main CFD Forum 0 January 30, 2017 04:08
Rotating motion simulation in fluent yusuf.5ayat ANSYS 0 January 10, 2017 06:18
using chemkin JMDag2004 OpenFOAM Pre-Processing 2 March 8, 2016 22:38
[snappyHexMesh] determining displacement for added points CFDnewbie147 OpenFOAM Meshing & Mesh Conversion 1 October 22, 2013 09:53
Residual level setting of Fluent lhlh ANSYS 2 November 17, 2012 21:35


All times are GMT -4. The time now is 16:30.