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

New boundary condition implementation for 1D-baffles using codeStream.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 4, 2018, 05:56
Default New boundary condition implementation for 1D-baffles using codeStream.
  #1
Member
 
Marco Bernardes
Join Date: May 2009
Posts: 57
Rep Power: 16
masb is on a distinguished road
Hi,



I'm trying to implement a new boundary condition for 1D-baffles using codeStream.
The BC should read the neighbor cells of an internal 1D-baffle and verify if the temperature at the left-hand side is greater than the temperature at the right-hand side.
If yes, the baffle's temperature should be set equal to the temperature at the neighbor cells.
If not, the BC should not work.

I'm trying to induce a unidirectional conductive heat flow for a Laplacian solver.
I could already start the programming but I don't know how to go further. How can I read the temperature from the neighbor cells?


Is it possible to set the heat flux equal to zero?


Thanks in advance!

Marco.





plate
{
type fixedValue;
value #codeStream
{
codeInclude
#{
#include "fvCFD.H"
#include "faceList.H"
#};

codeOptions
#{
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
#};

//libs needed to visualize BC in paraview
codeLibs
#{
-lmeshTools \
-lfiniteVolume
#};

code
#{
const IOdictionary& d = static_cast<const IOdictionary&>
(
dict.parent().parent()
);
const fvMesh& mesh = refCast<const fvMesh>(d.db());
const label id = mesh.boundary().findPatchID("plate");
const fvPatch& patch = mesh.boundary()[id];

scalarField T(patch.size(), scalar(273));

forAll(T, i)
{
T[i] = scalar(777);
}

T.writeEntry("", os);
#};
};
}

Last edited by masb; June 5, 2018 at 03:03.
masb is offline   Reply With Quote

Reply

Tags
boundaries condition, codestream; setfields;


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
Question about adaptive timestepping Guille1811 CFX 25 November 12, 2017 17:38
several fields modified by single boundary condition schröder OpenFOAM Programming & Development 3 April 21, 2015 05:09
CFX fails to calculate a diffuser pipe flow shenying0710 CFX 7 March 26, 2013 04:13
External Radiation Boundary Condition for Grid Interface CFD XUE FLUENT 0 July 9, 2010 02:53
External Radiation Boundary Condition (Two sided wall), Grid Interface CFD XUE FLUENT 0 July 8, 2010 06:49


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