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

Matrix manipulation without use of a dictionary ?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 13, 2022, 22:51
Default Matrix manipulation without use of a dictionary ?
  #1
Member
 
Join Date: Mar 2019
Posts: 86
Rep Power: 7
celestial is on a distinguished road
Good evening

I want to assign A and b in Ax=b where x is my scalar field:


fvScalarMatrix xEqn
(
fvm::ddt(x) + ......
) ;

xEqn.internalCoeffs()[patchid]= whatever;

xEqn.boundaryCoeffs()[patchid]= whatever;

xEqn.solve();



I could not run the program without getting a complaint about patch type and constraint type required under file 0/x. i.e., I had to add something like

boundaryField
{
patchname
{
type mixed;
valueFraction uniform 0.0;
refValue uniform 0.0;
refGradient uniform 0.0;
}


in that file 0/x

I chose mixed because it seems to be the most general generic boundary condition in OpenFOAM.

It would have been nice if the dictionary had not been required and I hope that my above addition to 0/x does not nullify the above assignment in my program.

Any comments welcome
celestial is offline   Reply With Quote

Old   October 16, 2022, 13:17
Default
  #2
Member
 
Join Date: Mar 2019
Posts: 86
Rep Power: 7
celestial is on a distinguished road
The good news is that adding

forAll(patchname, i)
{

Info<< " intCoeff = "
<< xEqn.internalCoeffs()[patchid][i] << " bndCoeff = "
<< xEqn.boundaryCoeffs()[patchid][i] << " s\n" << endl;

}

after the 3 lines

xEqn.internalCoeffs()[patchid]= bigfixednumber1;

xEqn.boundaryCoeffs()[patchid]= bigfixednumber2;

xEqn.solve();


clearly indicates that the above values are not modified by the dictionary



boundaryField
{
patchname
{
type mixed;
valueFraction uniform 0.0;
refValue uniform 0.0;
refGradient uniform 0.0;
}


in file 0/x
celestial 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
Matrix manipulation Za-ck OpenFOAM Programming & Development 0 July 18, 2018 06:44
ill defined primitiveEntry starting at keyword 'value' on line 197 ChangeDictionary Struggle_Achieve OpenFOAM Pre-Processing 2 December 20, 2017 04:58
Force can not converge colopolo CFX 13 October 4, 2011 23:03
OpenFOAM version 1.6 details lakeat OpenFOAM Running, Solving & CFD 42 August 26, 2009 22:47
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51


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