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

Assigning values to read-only location

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 10, 2021, 09:20
Default Assigning values to read-only location
  #1
New Member
 
Saumava Dey
Join Date: Sep 2020
Posts: 29
Rep Power: 6
saumavadey is on a distinguished road
Parts of my code read as:

volScalarField h
(
IOobject
(
"h",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

-------------------------------------------------------------
fvScalarMatrix h_Eqn
(
(rho_frac*F)*fvm::ddt(h)
==
fvm::laplacian(Ku,h)
+
rho_frac*grad_Kuz
+
rhoC_frac*q
);

h_Eqn.relax();
h_Eqn.solve();

-------------------------------------------------------------
Now after solving for h, I need to reassign the values of h before it passes on to the next time-step. The values of the h field which are having values less than -1 are to be set to -1. This modified h field has to be passed on the next time step.

How to accomplish this?
saumavadey 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
How to read values in a file to a source file? qkrtjdrns OpenFOAM Running, Solving & CFD 3 April 8, 2020 05:18
using chemkin JMDag2004 OpenFOAM Pre-Processing 2 March 8, 2016 23:38
Read gradient values of constantAlphaContactAngle styleworker OpenFOAM Programming & Development 0 November 25, 2013 09:26
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem Attesz OpenFOAM Meshing & Mesh Conversion 12 May 2, 2013 11:52
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30


All times are GMT -4. The time now is 13:12.