|
[Sponsors] |
November 11, 2020, 05:28 |
in modifying "advective"B.C.
|
#1 |
New Member
Kosuke Seto
Join Date: Jan 2020
Posts: 10
Rep Power: 6 |
Hi, FOAMers.
I'm modifying the "advective" boundary condition to make sound generated from flow fields go through the boundaries without reflecting. I do know that the boundary condition "waveTransmissive" will do, but this is for the compressible analysis, and I'm doing incompressible ones so I'm modifying "advective". My question is as follows. In this boundary condition, the member function "advectionSpeed()" determine the speed of the sound at the boundaries. Code:
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> Foam::tmp<Foam::scalarField> Foam::soundAdvectiveFvPatchField<Type>::advectionSpeed() const { const surfaceScalarField& phi = this->db().objectRegistry::template lookupObject<surfaceScalarField> (phiName_); fvsPatchField<scalar> phip = this->patch().template lookupPatchField<surfaceScalarField, scalar> ( phiName_ ); if (phi.dimensions() == dimDensity*dimVelocity*dimArea) { const fvPatchScalarField& rhop = this->patch().template lookupPatchField<volScalarField, scalar> ( rhoName_ ); return phip/(rhop*this->patch().magSf()); } else { return phip/this->patch().magSf(); } } Off cause, the situation is not this easy. Then, how can I configure the sound speed here? From above, the variable phip is declared as fvsPatchField<scalar>, but writing fvsPatchField<scalar> soundSpeed_; in the header file doesn't work. Thanks for any help! Kosuke |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Modifying stressedFoam for geometric non-linearity | mn14cat | OpenFOAM Programming & Development | 0 | May 25, 2020 12:20 |
Create a new field without modifying built-in solver? | gryphaea1635 | OpenFOAM Pre-Processing | 1 | November 4, 2019 05:13 |
Compile error when modifying LESdelta | Alisa_W | OpenFOAM Programming & Development | 0 | January 26, 2019 10:40 |
Modifying the laplacian operator | mlawson | OpenFOAM Running, Solving & CFD | 22 | July 16, 2018 05:56 |
IGG - modifying curves | evan247 | Fidelity CFD | 2 | December 8, 2015 06:00 |