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

wavetransmissive localEuler

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 19, 2013, 04:48
Default wavetransmissive localEuler
  #1
Member
 
Join Date: Nov 2012
Posts: 83
Rep Power: 13
Henning86 is on a distinguished road
hi,



i made some modification on the wavetransmissive/advective Bc to include the localEuler ddt scheme:

it is based on the thread( and 2 links for local Euler for rhoCentralFoam):


http://www.cfd-online.com/Forums/ope...-openfoam.html

http://www.cfd-online.com/Forums/ope...nge-kutta.html

Code:
--- ../OpenFOAM-2.1.1/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C +++ /opt/openfoam211/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C @@ -30,6 +30,7 @@
#include "EulerDdtScheme.H"
#include "CrankNicholsonDdtScheme.H"
#include "backwardDdtScheme.H"
+#include "localEulerDdtScheme.H" //add
 
 
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@@ line 215 ++@@
 
scalarField alpha(w*deltaT*this->patch().deltaCoeffs()); // removed the const
label patchi = this->patch().index();
// Non-reflecting outflow boundary
// If lInf_ defined setup relaxation to the value fieldInf_.
if (lInf_ > SMALL)
{
// Calculate the field relaxation coefficient k (See notes)
scalarField k(w*deltaT/lInf_); // removed the const
 
 
@@ line 251++@@
//insert this:
else if (ddtScheme == fv::localEulerDdtScheme<scalar>::typeName)
{
// only works with rDeltaT hardcoded
const volScalarField& vsfrDeltaT =
this->db().objectRegistry::lookupObject<volScalarField>("rDeltaT");
const scalarField& prDeltaT = vsfrDeltaT.boundaryField()[patchi];
scalarField alpha(w/prDeltaT*this->patch().deltaCoeffs());
scalarField k(w/prDeltaT/lInf_); 
 
this->refValue() =
(
field.oldTime().boundaryField()[patchi] + k*fieldInf_
)/(1.0 + k);
this->valueFraction() = (1.0 + k)/(1.0 + alpha + k);
}
@@ line 295++@@
//insert this:
 
else if (ddtScheme == fv::localEulerDdtScheme<scalar>::typeName)
{
// only works with rDeltaT hardcoded
const volScalarField& vsfrDeltaT =
this->db().objectRegistry::lookupObject<volScalarField>("rDeltaT");
const scalarField& prDeltaT = vsfrDeltaT.boundaryField()[patchi];
scalarField alpha(w/prDeltaT*this->patch().deltaCoeffs());
this->refValue() = field.oldTime().boundaryField()[patchi];
this->valueFraction() = 1.0/(1.0 + alpha);
}
if you want to use the wave transmissive BC with LTS you need to recompile the libary "finiteVolume". i would recommend it to recompile it in at the $(LIB_SRC) (main folder). If you do it in your local folder (FOAM_USER_LIBBIN) you get a double free or corruption error at the end of the run because this libary is pretty much used by every other libary


dont forget to make a backup before before compiling

Best regards

Henning

Last edited by Henning86; November 23, 2013 at 12:47.
Henning86 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
OpenFOAM: MRFSimpleFOAM with waveTransmissive hm86 OpenFOAM Running, Solving & CFD 1 October 12, 2014 01:17
[swak4Foam] how to use waveTransmissive in groovyBC? immortality OpenFOAM Community Contributions 4 January 28, 2013 07:31
are advecive and waveTransmissive different? immortality OpenFOAM Running, Solving & CFD 0 January 25, 2013 19:04
Could you help me about how to use the waveTransmissive BC for sound wave? zhongsy OpenFOAM 0 July 13, 2012 02:59
WaveTransmissive BC with fieldInf%3d1 schmidt_d OpenFOAM Running, Solving & CFD 1 February 8, 2011 06:09


All times are GMT -4. The time now is 06:23.