As of SQL Server 2008 R2 SP1, this is nice and easy, you can just query the dm_server_services DMV and look for the clustered service:
select cluster_nodename from [sys].[dm_server_services] where is_clustered = 'Y'
Earlier versions of SQL server, you may have to do something like read the registry, which you can do using the following code:
declare @dir nvarchar(20)
exec xp_regread
N'HKEY_LOCAL_MACHINE',
N'SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName',
N'ComputerName',
@dir OUTPUT
select @dir
Edit:
So to get information on which node a cluster resource group is running on, you need to use WMI, the following powershell code will return the cluster node that the specified group is currently active on, as for doing this via T-SQL, you could either shell this out using xp_cmdshell, or create a table in your DB to store this value, append a little bit of code to the powershell to get it to update the value in the table each time it runs and run it as a powershell SQL agent job:
$group = "Available Storage"
$computer = "."
$hostName = Get-WmiObject -Authentication PacketPrivacy -Impersonation Impersonate -Namespace root\MSCluster -ComputerName $computer -Class MSCluster_NodeToActiveGroup | Where-Object {$_.PartComponent -like "*$group*"} | Select-Object -ExpandProperty GroupComponent | Out-String
$hostName = $hostName.TrimStart("MSCluster_Node.Name=")
$hostName = $hostName.TrimStart()
$hostName = $hostName.TrimEnd()
Write-Host $hostName.Substring(1,$hostname.Length-2)
It also would be pretty trivial to re-write this in C# and create a SQL server CLR function that accepts the parameters of a computer to run the query against and the group to check, then return the server name.
Hope this helps at least get you on your way.