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

Custom boundary condition in OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 26, 2019, 02:19
Default Custom boundary condition in OpenFOAM
  #1
New Member
 
Florida
Join Date: Feb 2018
Location: Florida
Posts: 12
Rep Power: 8
shinjanghosh is on a distinguished road
Hi FOamers,

I am currently trying to write a boundary condition which reads like this :
q = −ρ(w · v) − ρ wnvn − μ(n · ∇wn) − ω1ρvnvn
(q is the variable which needs a patch update.)

I'm having trouble including the effective viscosity (which contains the molecular and turbulent viscosity) in the patch update. These are the expression I have used for the member functions in the boundary condition code :

const fvsPatchField<scalar>& phip =
patch().lookupPatchField<surfaceScalarField, scalar>("phi");

const fvsPatchField<scalar>& phiap =
patch().lookupPatchField<surfaceScalarField, scalar>("phia");

const fvPatchField<vector>& Up =
patch().lookupPatchField<volVectorField, vector>("U");

const fvPatchField<vector>& Uap =
patch().lookupPatchField<volVectorField, vector>("Ua");

const fvPatchField<scalar>& Tp =
patch().lookupPatchField<volScalarField, scalar>("T");


scalarField nueff = rasModel.nuEff()().boundaryField()

The last line is where I'm having the error as to how to access the nu_effective value from the solution itself like I did for the other quantities. Please let me know what you think.

Thanks,
Shinjan
shinjanghosh is offline   Reply With Quote

Old   August 26, 2019, 06:30
Default
  #2
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Hi!


Just a guess, sorry if I'm wrong, but this should be fine for any turbulence model not just RAS:
turbulence->nuEff();
But maybe you will have to look up for "turbulence" somehow in the BC.
simrego 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
Wind turbine simulation Saturn CFX 60 July 17, 2024 06:45
Cyclic boundary condition in foam-extend 4.0 rellumeister OpenFOAM Pre-Processing 2 March 3, 2020 09:03
OpenFOAM 4.0 Released CFDFoundation OpenFOAM Announcements from OpenFOAM Foundation 2 October 6, 2017 06:40
OpenFOAM v3.0+ ?? SBusch OpenFOAM 22 December 26, 2016 15:24
Low Mixing time Problem Mavier CFX 5 April 29, 2013 01:00


All times are GMT -4. The time now is 14:51.