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

how to modify the name of a specific variable

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 23, 2014, 12:05
Default how to modify the name of a specific variable
  #1
New Member
 
yalong cai
Join Date: Feb 2014
Location: New York
Posts: 13
Rep Power: 12
pizicai is on a distinguished road
Hello, everyone,

I am using openfoam-ext-3.0 and I am trying to combine two packages. my problem is described below:

in ~/foam/foam-extend-3.0/src/solidModels, which i think all the files inside are about solid simulation, there is a variable named 'sigma', which means the stress. I want to modify its name to 'SIGMA', so i could avoid conflicts when I want to combine two packages which both declare the term 'sigma' (same name but different meaning, that's why i have to change name to differentiate those two variable). to achieve this , I replace all the 'sigma' and 'Sigma' appeared in src/solidModels with 'SIGMA',
then i go the directory : ~/foam/foam-extend-3.0//src , and type: wmake libso solidModels
all the files could be compiled smoothly.

then I go to the directory where my own solver files locate, type: wmake

all the files could be compiled smoothly.

then I go to the directory where my test case files ( just a test example) locate, all the files have been modified according to the modification of the term 'sigma', e.g. in the file fvSchems, term 'div(sigma)' has changed to 'div(SIGMA)'.

then i run the case,

what confuses me is the terminal warns there is a error:

--------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------
--> FOAM FATAL ERROR:

request for volSymmTensorField sigma from objectRegistry solid failed
available objects of type volSymmTensorField are

2
(
DSIGMA
SIGMA
)


From function objectRegistry::lookupObject<Type>(const word&) const
in file /home/ellen/foam/foam-extend-3.0/src/foam/lnInclude/objectRegistryTemplates.C at line 139.

FOAM aborting
Aborted (core dumped)
--------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------


since the volSymmTensorField sigma is still requested, I think there should be other files that declare 'sigma', which i missed. i wonder if you know where are those files that declare sigma ( stress, not others like 'sigma' defined in interfoam is tension coefficient of water).

thanks a lot, and if you need anything, feel free to contact me, and i will send your relevant files.

Yalong
pizicai is offline   Reply With Quote

Old   September 23, 2014, 12:15
Default
  #2
New Member
 
yalong cai
Join Date: Feb 2014
Location: New York
Posts: 13
Rep Power: 12
pizicai is on a distinguished road
what i am sure is all 'sigma' appeared in ~/foam/foam-extend-3.0/src/solidModels has modified, so if there is some file contain 'sigma' (stress), it should be outside of solidModels, but what file also deals with solid problems and thus use stress term?
pizicai is offline   Reply With Quote

Old   September 23, 2014, 12:30
Default
  #3
New Member
 
yalong cai
Join Date: Feb 2014
Location: New York
Posts: 13
Rep Power: 12
pizicai is on a distinguished road
after my check, I found this error comes out when defining the DU equation (DU means displacement)

the corresponding equation is :

------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------

DU.storePrevIter();
Info << "HEHE7 " << endl;
fvVectorMatrix DUEqn
(
Cn*rho*fvm::ddt(DU)
- Co*rho*DV.oldTime()
+ Coo*rho*DV.oldTime().oldTime()
==
fvm::laplacian(2*mu + lambda, DU, "laplacian(DDU,DU)")
- fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
+ fvc::div
(
mu*gradDU.T()
+ lambda*(I*tr(gradDU))
+ mu*(gradDU&gradDU.T())
+ 0.5*lambda*(I*tr(gradDU & gradDU.T()))
+ (SIGMA & DF.T())
+ (DSIGMA & DF.T()),
"div(SIGMA)"
)

);

------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
pizicai is offline   Reply With Quote

Old   September 23, 2014, 15:14
Default
  #4
New Member
 
yalong cai
Join Date: Feb 2014
Location: New York
Posts: 13
Rep Power: 12
pizicai is on a distinguished road
right now, I narrow down the scale of the problem:

------------------------------------------------------------------------------
------------------------------------------------------------------------------
fvVectorMatrix DUEqn
(
Cn*rho*fvm::ddt(DU)
- Co*rho*DV.oldTime()
+ Coo*rho*DV.oldTime().oldTime()
==
fvm::laplacian(2*mu + lambda, DU, "laplacian(DDU,DU)")
- fvc::laplacian(mu + lambda, DU, "laplacian(DDU,DU)")
+ fvc::div
(
mu*gradDU.T()
+ lambda*(I*tr(gradDU))
+ mu*(gradDU&gradDU.T())
+ 0.5*lambda*(I*tr(gradDU & gradDU.T()))
+(SIGMA & DF.T())
+ (DSIGMA & DF.T()),
"div(SIGMA)"
)
------------------------------------------------------------------------------
------------------------------------------------------------------------------

the problem is caused by div(SIGMA)

it is this term that request 'sigma', is there anybody know something about div() ?
pizicai is offline   Reply With Quote

Reply

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
Constant velocity of the material Sas CFX 15 July 13, 2010 09:56
Specific heat in STAR-CD Andrew Siemens 3 September 4, 2009 00:33
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55
Problem in installation of OpenFOAM sachin OpenFOAM Installation 7 January 22, 2008 02:40
Env variable not set gruber2 OpenFOAM Installation 5 December 30, 2005 05:27


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