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

0/T vary temperature with z position

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 3, 2025, 17:21
Default 0/T vary temperature with z position
  #1
New Member
 
Ibrahim I
Join Date: Feb 2024
Posts: 12
Rep Power: 3
Ibrahim_I is on a distinguished road
Hello, I am modelling a geothermal system (i.e. pipes underground) and am applying a fixed temperature to the outer wall. This fixed temperature should vary with depth (gradient of 0.1C/m). I'm trying to use a coded boundary condition but unsure how to get the z position.

The T value should be T0 - 0.1*z , where z is negative

Some attempts to get z based on other posts are:
const volVectorField& U = mesh().lookupObject<volVectorField>("U");
const volScalarField z = U.mesh().C() & vector(0,0,1);

const scalarField& z = mesh_.C().component(2);

But I get error: undeclared identifier 'mesh'. I tried this in 0/T file

Thanks
Ibrahim_I is offline   Reply With Quote

Reply

Tags
position dependent, temperature bc

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
PEMFC tutorial case problem Suleyman41 FLUENT 2 July 15, 2023 12:16
Weird (unphysical) temperature rise with chtMultiRegionFoam Phil910 OpenFOAM Running, Solving & CFD 3 November 9, 2022 10:25
Averaging over iterations for steady-state simulation CFD student Fluent UDF and Scheme Programming 8 September 22, 2022 04:39
Vary velocity at inlet based on position swadejaxsun FLUENT 1 August 2, 2018 20:36
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion faizan_habib7 CFX 4 February 1, 2016 18:00


All times are GMT -4. The time now is 05:01.