[Nek5000-users] How to give NEK5000 boundary conditions to exodus mesh file

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Thu May 31 09:38:08 CDT 2018


Yes. The same results. 

Could you please tell me why there is a 5 on the bc(5,j,i,1)? 

And the value of bc(5,j,i,1) was zero for all the iteration. 

Thank you 



De: "nek5000-users" <nek5000-users at lists.mcs.anl.gov> 
À: "nek5000-users" <nek5000-users at lists.mcs.anl.gov> 
Envoyé: Jeudi 31 Mai 2018 16:28:59 
Objet: Re: [Nek5000-users] How to give NEK5000 boundary conditions to exodus mesh file 

you have to add the print statement before you enter the if statements. 

Marco 




On May 31, 2018, at 10:25 AM, [ mailto:nek5000-users at lists.mcs.anl.gov | 
nek5000-users at lists.mcs.anl.gov ] wrote: 

c----------------------------------------------------------------------- 
subroutine usrdat 
include 'SIZE' 
include 'TOTAL' 

do i=1,nelt 
do j=1,2*ndim 
if(bc(5,j,i,1).eq.1) then 
cbc(j,i,1)='O ' 
write (6,1) j,i,nelt,ndim,bc(5,j,i,1) 
1 format(i4,i4,i4,i4,7f20.8) 
elseif(bc(5,j,i,1).eq.2) then 
cbc(j,i,1)='W ' 
write (6,2) j,i,nelt,ndim,bc(5,j,i,1) 
2 format(i4,i4,i4,i4,7f20.8) 
elseif(bc(5,j,i,1).eq.3) then 
cbc(j,i,1)='W ' 
write (6,3) j,i,nelt,ndim,bc(5,j,i,1) 
3 format(i4,i4,i4,i4,7f20.8) 
elseif(bc(5,j,i,1).eq.4) then 
cbc(j,i,1)='W ' 
write (6,4) j,i,nelt,ndim,bc(5,j,i,1) 
4 format(i4,i4,i4,i4,7f20.8) 
elseif(bc(5,j,i,1).eq.5) then 
cbc(j,i,1)='V ' 
write (6,5) j,i,nelt,ndim,bc(5,j,i,1) 
5 format(i4,i4,i4,i4,7f20.8) 
elseif(bc(5,j,i,1).eq.6) then 
cbc(j,i,1)='W ' 
write (6,6) j,i,nelt,ndim,bc(5,j,i,1) 
6 format(i4,i4,i4,i4,7f20.8) 
else 
cbc(j,i,1)='E ' 
write (6,7) j,i,nelt,ndim,bc(5,j,i,1) 
7 format(i4,i4,i4,i4,7f20.8) 

endif 
enddo 
enddo 

call gen_rea(0) 
call exit 
return 
end 
c----------------------------------------------------------------------- 

i used this and only bold lines of code are executed at every time step and a small piece of the results is shown below 

1 9991000 3 0.00000000 
2 9991000 3 0.00000000 
3 9991000 3 0.00000000 
4 9991000 3 0.00000000 
5 9991000 3 0.00000000 
6 9991000 3 0.00000000 



Thank you 

Sijo 





De: "nek5000-users" < [ mailto:nek5000-users at lists.mcs.anl.gov | nek5000-users at lists.mcs.anl.gov ] > 
À: "nek5000-users" < [ mailto:nek5000-users at lists.mcs.anl.gov | nek5000-users at lists.mcs.anl.gov ] > 
Envoyé: Jeudi 31 Mai 2018 16:12:12 
Objet: Re: [Nek5000-users] How to give NEK5000 boundary conditions to exodus mesh file 

You should output values of i, j, next, ndim and bc(5,j,i,1) for sanity check. 

Marco 


BQ_BEGIN

On May 31, 2018, at 10:07 AM, [ mailto:nek5000-users at lists.mcs.anl.gov | 
nek5000-users at lists.mcs.anl.gov ] wrote: 

When I checked the loop I can see that only the bold letter codes are executing in all the iteration. 

subroutine usrdat 
include 'SIZE' 
include 'TOTAL' 

do i=1,nelt 
do j=1,2*ndim 
if(bc(5,j,i,1).eq.1) then 
cbc(j,i,1)='O ' 
elseif(bc(5,j,i,1).eq.2) then 
cbc(j,i,1)='W ' 
elseif(bc(5,j,i,1).eq.3) then 
cbc(j,i,1)='W ' 
elseif(bc(5,j,i,1).eq.4) then 
cbc(j,i,1)='W ' 
elseif(bc(5,j,i,1).eq.5) then 
cbc(j,i,1)='V ' 
elseif(bc(5,j,i,1).eq.6) then 
cbc(j,i,1)='W ' 
else 
cbc(j,i,1)='E ' 
endif 
enddo 
enddo 

call gen_rea(0) 
call exit 
return 
end 

Thanks 
Sijo 


De: "nek5000-users" < [ mailto:nek5000-users at lists.mcs.anl.gov | nek5000-users at lists.mcs.anl.gov ] > 
À: "nek5000-users" < [ mailto:nek5000-users at lists.mcs.anl.gov | nek5000-users at lists.mcs.anl.gov ] > 
Envoyé: Jeudi 31 Mai 2018 15:54:04 
Objet: Re: [Nek5000-users] How to give NEK5000 boundary conditions to exodus mesh file 

It probably means that the boundary conditions are not correctly set in usrdat(). Can you add a write statement in each line of the do loop to check wether boundary conditions are properly set when running? 

Also add ‘call exist’ after setting the boundary conditions that way Nek5000 will automatically exit. 

Marco 


BQ_BEGIN

On May 31, 2018, at 9:51 AM, [ mailto:nek5000-users at lists.mcs.anl.gov | 
nek5000-users at lists.mcs.anl.gov ] wrote: 

Yes. I see the problem now. 

it shows there is 1000 elements but all the co ordinates are zero. In fact there is nothing and all the boundary conditions are E. 

Could you please tell me where i am probably wrong? It was showing correct number of elemnts and the range of domain. Even when i was using exo2nek it was showing the correct numbers. And genmap worked as well. 

Regards 
Sijo 



De: "nek5000-users" < [ mailto:nek5000-users at lists.mcs.anl.gov | nek5000-users at lists.mcs.anl.gov ] > 
À: "nek5000-users" < [ mailto:nek5000-users at lists.mcs.anl.gov | nek5000-users at lists.mcs.anl.gov ] > 
Envoyé: Jeudi 31 Mai 2018 15:43:20 
Objet: Re: [Nek5000-users] How to give NEK5000 boundary conditions to exodus mesh file 

Can you add ‘call gen_rea(0)’ after setting the boundary conditions in usrdat()? It will generate a *.rea file with all boundary conditions. 

Marco 


BQ_BEGIN

On May 31, 2018, at 9:37 AM, [ mailto:nek5000-users at lists.mcs.anl.gov | 
nek5000-users at lists.mcs.anl.gov ] wrote: 


I generated again it didnt work. 
I will explain what I did so far. 

I made a cube fluid mesh in ICEM. 

Then I gave B.Cs to the cube as follows : outlet = Sideset no : 1, inlet = Sideset no : 5 , Wall_up = Sideset no:4 ,Wall_down = Sideset no:3 , P_Wall_Right =Side_set 6, P_wall_left = Sideset no: 2 
After that I exported the mesh from ICEM to exodus.exo format file. 

Then using exo2nek tool from NEK5000, I converted the above file to exodus.re2 file. (Then I tried to convert into rea file but thrown some errors). 
Then I mapped the file into exodus.ma2 file. 

Then from example Turbulent channel I took a .par file to give parameters. 

Now I also given the B.Cs through the .usr file. 
as follows: 

c----------------------------------------------------------------------- 
subroutine usrdat 
include 'SIZE' 
include 'TOTAL' 


do i=1,nelt 
do j=1,2*ndim 
if(bc(5,j,i,1).eq.1) then 
cbc(j,i,1)='O ' 
elseif(bc(5,j,i,1).eq.2) then 
cbc(j,i,1)='W ' 
elseif(bc(5,j,i,1).eq.3) then 
cbc(j,i,1)='W ' 
elseif(bc(5,j,i,1).eq.4) then 
cbc(j,i,1)='W ' 
elseif(bc(5,j,i,1).eq.5) then 
cbc(j,i,1)='V ' 
elseif(bc(5,j,i,1).eq.6) then 
cbc(j,i,1)='W ' 
else 
cbc(j,i,1)='E ' 
endif 
enddo 
enddo 


return 
end 
c----------------------------------------------------------------------- 


Then in my folder I have .ma2,.re2,.par,.usr files to run this case and when i run the case I get an error shown before. 

Could you please tell me, if therer is anything wrong? 

Thank you 

De: "nek5000-users" < [ mailto:nek5000-users at lists.mcs.anl.gov | nek5000-users at lists.mcs.anl.gov ] > 
À: "nek5000-users" < [ mailto:nek5000-users at lists.mcs.anl.gov | nek5000-users at lists.mcs.anl.gov ] > 
Envoyé: Jeudi 31 Mai 2018 15:22:49 
Objet: Re: [Nek5000-users] How to give NEK5000 boundary conditions to exodus mesh file 


Did you generate a new map file after changing the BCs? 

This matters when switching periodic bcs on or off... 

Paul 


From: Nek5000-users < [ mailto:nek5000-users-bounces at lists.mcs.anl.gov | nek5000-users-bounces at lists.mcs.anl.gov ] > on behalf of [ mailto:nek5000-users at lists.mcs.anl.gov | 
nek5000-users at lists.mcs.anl.gov ] < [ mailto:nek5000-users at lists.mcs.anl.gov | nek5000-users at lists.mcs.anl.gov ] > 
Sent: Thursday, May 31, 2018 8:12:55 AM 
To: [ mailto:nek5000-users at lists.mcs.anl.gov | nek5000-users at lists.mcs.anl.gov ] 
Subject: Re: [Nek5000-users] How to give NEK5000 boundary conditions to exodus mesh file 
I do not think this method supports periodic boundary conditions. You will have to replace the periodic boundary conditions with wall boundary conditions and see it is runs. 

Marco 


BQ_BEGIN

On May 31, 2018, at 9:11 AM, [ mailto:nek5000-users at lists.mcs.anl.gov | nek5000-users at lists.mcs.anl.gov ] wrote: 


Hi Marco, 

I tried and it compiled . But before starting the time step it failed. 
Its a very simple case, the water flowing throgh a cube. So I have inlet, outlet, walls on upside and bottom and periodic conditions on side walls. 
I get this error: 

Matrix: 0 aa 6 6 6 
0 aa 8.33333E+01 -4.87842E+01 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 
0 aa -4.87842E+01 8.66667E+01 -4.87842E+01 7.11752E+00 -1.66667E+00 0.00000E+00 
0 aa 0.00000E+00 -4.87842E+01 8.33333E+01 -4.16667E+01 7.11752E+00 0.00000E+00 
0 aa 0.00000E+00 7.11752E+00 -4.16667E+01 8.33333E+01 -4.87842E+01 0.00000E+00 
0 aa 0.00000E+00 -1.66667E+00 7.11752E+00 -4.87842E+01 Infinity -Infinity 
0 aa 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 -Infinity Infinity 

Matrix: 0 bb 6 6 6 
0 bb 4.16667E-02 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 
0 bb 0.00000E+00 1.66667E-02 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 
0 bb 0.00000E+00 0.00000E+00 4.16667E-02 0.00000E+00 0.00000E+00 0.00000E+00 
0 bb 0.00000E+00 0.00000E+00 0.00000E+00 4.16667E-02 0.00000E+00 0.00000E+00 
0 bb 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 8.33333E-03 0.00000E+00 
0 bb 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 

Matrix: 0 Aeig 6 6 6 
0 Aeig 8.33333E+01 -4.87842E+01 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 
0 Aeig -4.87842E+01 8.66667E+01 -4.87842E+01 7.11752E+00 -1.66667E+00 0.00000E+00 
0 Aeig 0.00000E+00 -4.87842E+01 8.33333E+01 -4.16667E+01 7.11752E+00 0.00000E+00 
0 Aeig 0.00000E+00 7.11752E+00 -4.16667E+01 8.33333E+01 -4.87842E+01 0.00000E+00 
0 Aeig 0.00000E+00 -1.66667E+00 7.11752E+00 -4.87842E+01 Infinity -Infinity 
0 Aeig 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 -Infinity Infinity 

Matrix: 0 Deig 1 6 6 
0 Deig 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 
Error in generalev, info= 12 6 -6 

an error occured: dying ... 



Could you please tell me why? 

Thank you 

Sijo GEORGE 

De: "nek5000-users" < [ mailto:nek5000-users at lists.mcs.anl.gov | nek5000-users at lists.mcs.anl.gov ] > 
À: "nek5000-users" < [ mailto:nek5000-users at lists.mcs.anl.gov | nek5000-users at lists.mcs.anl.gov ] > 
Envoyé: Jeudi 31 Mai 2018 14:52:40 
Objet: Re: [Nek5000-users] How to give NEK5000 boundary conditions to exodus mesh file 

I specify the boundary conditions in the usrdat subroutine using the following piece of code 

do i=1,nelt 
do j=1,2*ndim 
if(bc(5,j,i,1).eq.1) then 
cbc(j,i,1)='mv ' 
elseif(bc(5,j,i,1).eq.2) then 
cbc(j,i,1)='W ' 
elseif(bc(5,j,i,1).eq.3) then 
cbc(j,i,1)='W ' 
elseif(bc(5,j,i,1).eq.4) then 
cbc(j,i,1)='W ' 
else 
cbc(j,i,1)='E ' 
endif 
enddo 
enddo 

Marco 


BQ_BEGIN

On May 31, 2018, at 8:50 AM, [ mailto:nek5000-users at lists.mcs.anl.gov | nek5000-users at lists.mcs.anl.gov ] wrote: 

Hi Neks, 

I did the conversion of a mesh from ICEM to exodus file then to re2 file. 

But I am bit confused on the boundary conditions. Because from ICEM before I export to exodus I give the B.Cs as side set numbers and after the conversion to re2 I wont be able to put the boundary conditions in NEK format. 

So could you please tell me how you put the BC in NEK5000 format to a mesh file with exodus format. 

Thank you 
_______________________________________________ 
Nek5000-users mailing list 
[ mailto:Nek5000-users at lists.mcs.anl.gov | Nek5000-users at lists.mcs.anl.gov ] 
[ https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users | https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users ] 





_______________________________________________ 
Nek5000-users mailing list 
[ mailto:Nek5000-users at lists.mcs.anl.gov | Nek5000-users at lists.mcs.anl.gov ] 
[ https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users | https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users ] 
_______________________________________________ 
Nek5000-users mailing list 
[ mailto:Nek5000-users at lists.mcs.anl.gov | Nek5000-users at lists.mcs.anl.gov ] 
[ https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users | https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users ] 

BQ_END



_______________________________________________ 
Nek5000-users mailing list 
[ mailto:Nek5000-users at lists.mcs.anl.gov | Nek5000-users at lists.mcs.anl.gov ] 
[ https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users | https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users ] 
_______________________________________________ 
Nek5000-users mailing list 
[ mailto:Nek5000-users at lists.mcs.anl.gov | Nek5000-users at lists.mcs.anl.gov ] 
[ https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users | https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users ] 

BQ_END



_______________________________________________ 
Nek5000-users mailing list 
[ mailto:Nek5000-users at lists.mcs.anl.gov | Nek5000-users at lists.mcs.anl.gov ] 
[ https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users | https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users ] 
_______________________________________________ 
Nek5000-users mailing list 
[ mailto:Nek5000-users at lists.mcs.anl.gov | Nek5000-users at lists.mcs.anl.gov ] 
[ https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users | https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users ] 

BQ_END



_______________________________________________ 
Nek5000-users mailing list 
[ mailto:Nek5000-users at lists.mcs.anl.gov | Nek5000-users at lists.mcs.anl.gov ] 
[ https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users | https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users ] 
_______________________________________________ 
Nek5000-users mailing list 
[ mailto:Nek5000-users at lists.mcs.anl.gov | Nek5000-users at lists.mcs.anl.gov ] 
[ https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users | https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users ] 

BQ_END



_______________________________________________ 
Nek5000-users mailing list 
[ mailto:Nek5000-users at lists.mcs.anl.gov | Nek5000-users at lists.mcs.anl.gov ] 
https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users 
_______________________________________________ 
Nek5000-users mailing list 
[ mailto:Nek5000-users at lists.mcs.anl.gov | Nek5000-users at lists.mcs.anl.gov ] 
https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users 

BQ_END



_______________________________________________ 
Nek5000-users mailing list 
Nek5000-users at lists.mcs.anl.gov 
https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20180531/2f13be72/attachment-0001.html>


More information about the Nek5000-users mailing list